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.
import QtQuick 2.2
@ -21,8 +21,8 @@ Item
{
id: buttons;
anchors.bottom: parent.bottom;
anchors.left: parent.left;
anchors.bottom: parent.bottom
anchors.left: parent.left
spacing: UM.Theme.getSize("button_lining").width
Repeater
@ -41,13 +41,15 @@ Item
enabled: model.enabled && UM.Selection.hasSelection && UM.Controller.toolsEnabled
style: UM.Theme.styles.tool_button
onCheckedChanged: {
if (checked) {
base.activeY = y
onCheckedChanged:
{
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.
MouseArea
{
@ -57,7 +59,7 @@ Item
forceActiveFocus() //First grab focus, so all the text fields are updated
if(parent.checked)
{
UM.Controller.setActiveTool(null)
UM.Controller.setActiveTool(null);
}
else
{
@ -96,11 +98,13 @@ Item
width:
{
if (panel.item && panel.width > 0){
return Math.max(panel.width + 2 * UM.Theme.getSize("default_margin").width)
if (panel.item && panel.width > 0)
{
return Math.max(panel.width + 2 * UM.Theme.getSize("default_margin").width);
}
else {
return 0
else
{
return 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;
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;
}
}
@ -148,6 +152,6 @@ Item
anchors.horizontalCenter: parent.horizontalCenter
}
visible: toolHint.text != "";
visible: toolHint.text != ""
}
}