mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 06:28:59 +08:00
Code style
This commit is contained in:
parent
e4bdd8096a
commit
4a22bb3b69
@ -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 != ""
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user