Code style

This commit is contained in:
Ghostkeeper 2018-08-10 11:06:25 +02:00
parent e4bdd8096a
commit 4a22bb3b69
No known key found for this signature in database
GPG Key ID: 5252B696FB5E7C7A

View File

@ -1,4 +1,4 @@
// Copyright (c) 2015 Ultimaker B.V. // Copyright (c) 2018 Ultimaker B.V.
// Cura is released under the terms of the LGPLv3 or higher. // Cura is released under the terms of the LGPLv3 or higher.
import QtQuick 2.2 import QtQuick 2.2
@ -21,8 +21,8 @@ Item
{ {
id: buttons; id: buttons;
anchors.bottom: parent.bottom; anchors.bottom: parent.bottom
anchors.left: parent.left; anchors.left: parent.left
spacing: UM.Theme.getSize("button_lining").width spacing: UM.Theme.getSize("button_lining").width
Repeater Repeater
@ -41,13 +41,15 @@ Item
enabled: model.enabled && UM.Selection.hasSelection && UM.Controller.toolsEnabled enabled: model.enabled && UM.Selection.hasSelection && UM.Controller.toolsEnabled
style: UM.Theme.styles.tool_button style: UM.Theme.styles.tool_button
onCheckedChanged: { onCheckedChanged:
if (checked) { {
base.activeY = y if (checked)
{
base.activeY = y;
} }
} }
//Workaround since using ToolButton"s onClicked would break the binding of the checked property, instead //Workaround since using ToolButton's onClicked would break the binding of the checked property, instead
//just catch the click so we do not trigger that behaviour. //just catch the click so we do not trigger that behaviour.
MouseArea MouseArea
{ {
@ -57,7 +59,7 @@ Item
forceActiveFocus() //First grab focus, so all the text fields are updated forceActiveFocus() //First grab focus, so all the text fields are updated
if(parent.checked) if(parent.checked)
{ {
UM.Controller.setActiveTool(null) UM.Controller.setActiveTool(null);
} }
else else
{ {
@ -96,11 +98,13 @@ Item
width: width:
{ {
if (panel.item && panel.width > 0){ if (panel.item && panel.width > 0)
return Math.max(panel.width + 2 * UM.Theme.getSize("default_margin").width) {
return Math.max(panel.width + 2 * UM.Theme.getSize("default_margin").width);
} }
else { else
return 0 {
return 0;
} }
} }
height: panel.item ? panel.height + 2 * UM.Theme.getSize("default_margin").height : 0; height: panel.item ? panel.height + 2 * UM.Theme.getSize("default_margin").height : 0;
@ -124,7 +128,7 @@ Item
x: UM.Theme.getSize("default_margin").width; x: UM.Theme.getSize("default_margin").width;
y: UM.Theme.getSize("default_margin").height; y: UM.Theme.getSize("default_margin").height;
source: UM.ActiveTool.valid ? UM.ActiveTool.activeToolPanel : ""; source: UM.ActiveTool.valid ? UM.ActiveTool.activeToolPanel : ""
enabled: UM.Controller.toolsEnabled; enabled: UM.Controller.toolsEnabled;
} }
} }
@ -148,6 +152,6 @@ Item
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
visible: toolHint.text != ""; visible: toolHint.text != ""
} }
} }