mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 14:44:13 -06:00
Code-style
This commit is contained in:
parent
a1c3b8f3a8
commit
2f3f57c43d
1 changed files with 78 additions and 34 deletions
|
@ -14,9 +14,7 @@ Rectangle {
|
||||||
|
|
||||||
property real progress: UM.Backend.progress;
|
property real progress: UM.Backend.progress;
|
||||||
property int backendState: UM.Backend.state;
|
property int backendState: UM.Backend.state;
|
||||||
|
|
||||||
property bool activity: Printer.getPlatformActivity;
|
property bool activity: Printer.getPlatformActivity;
|
||||||
//Behavior on progress { NumberAnimation { duration: 250; } }
|
|
||||||
property int totalHeight: childrenRect.height + UM.Theme.getSize("default_margin").height
|
property int totalHeight: childrenRect.height + UM.Theme.getSize("default_margin").height
|
||||||
property string fileBaseName
|
property string fileBaseName
|
||||||
property string statusText:
|
property string statusText:
|
||||||
|
@ -26,21 +24,18 @@ Rectangle {
|
||||||
return catalog.i18nc("@label:PrintjobStatus", "Please load a 3d model");
|
return catalog.i18nc("@label:PrintjobStatus", "Please load a 3d model");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(base.backendState == 1)
|
switch(base.backendState)
|
||||||
{
|
{
|
||||||
return catalog.i18nc("@label:PrintjobStatus", "Preparing to slice...");
|
case 1:
|
||||||
}
|
return catalog.i18nc("@label:PrintjobStatus", "Preparing to slice...");
|
||||||
else if(base.backendState == 2)
|
case 2:
|
||||||
{
|
return catalog.i18nc("@label:PrintjobStatus", "Slicing...");
|
||||||
return catalog.i18nc("@label:PrintjobStatus", "Slicing...");
|
case 3:
|
||||||
}
|
return catalog.i18nc("@label:PrintjobStatus %1 is target operation","Ready to %1").arg(UM.OutputDeviceManager.activeDeviceShortDescription);
|
||||||
else if(base.backendState == 3)
|
case 4:
|
||||||
{
|
return catalog.i18nc("@label:PrintjobStatus", "Unable to Slice");
|
||||||
return catalog.i18nc("@label:PrintjobStatus %1 is target operation","Ready to %1").arg(UM.OutputDeviceManager.activeDeviceShortDescription);
|
default:
|
||||||
}
|
return "";
|
||||||
else if(base.backendState == 4)
|
|
||||||
{
|
|
||||||
return catalog.i18nc("@label:PrintjobStatus", "Unable to Slice")
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,12 +121,29 @@ Rectangle {
|
||||||
background: Rectangle
|
background: Rectangle
|
||||||
{
|
{
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
border.color: !control.enabled ? UM.Theme.getColor("action_button_disabled_border") :
|
border.color:
|
||||||
control.pressed ? UM.Theme.getColor("action_button_active_border") :
|
{
|
||||||
control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border")
|
if(!control.enabled)
|
||||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled") :
|
return UM.Theme.getColor("action_button_disabled_border");
|
||||||
control.pressed ? UM.Theme.getColor("action_button_active") :
|
else if(control.pressed)
|
||||||
control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
return UM.Theme.getColor("action_button_active_border");
|
||||||
|
else if(control.hovered)
|
||||||
|
return UM.Theme.getColor("action_button_hovered_border");
|
||||||
|
else
|
||||||
|
return UM.Theme.getColor("action_button_border");
|
||||||
|
}
|
||||||
|
color:
|
||||||
|
{
|
||||||
|
if(!control.enabled)
|
||||||
|
return UM.Theme.getColor("action_button_disabled");
|
||||||
|
else if(control.pressed)
|
||||||
|
return UM.Theme.getColor("action_button_active");
|
||||||
|
else if(control.hovered)
|
||||||
|
return UM.Theme.getColor("action_button_hovered");
|
||||||
|
else
|
||||||
|
return UM.Theme.getColor("action_button");
|
||||||
|
}
|
||||||
|
|
||||||
Behavior on color { ColorAnimation { duration: 50; } }
|
Behavior on color { ColorAnimation { duration: 50; } }
|
||||||
|
|
||||||
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2)
|
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2)
|
||||||
|
@ -139,9 +151,17 @@ Rectangle {
|
||||||
Label {
|
Label {
|
||||||
id: actualLabel
|
id: actualLabel
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
|
color:
|
||||||
control.pressed ? UM.Theme.getColor("action_button_active_text") :
|
{
|
||||||
control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text")
|
if(!control.enabled)
|
||||||
|
return UM.Theme.getColor("action_button_disabled_text");
|
||||||
|
else if(control.pressed)
|
||||||
|
return UM.Theme.getColor("action_button_active_text");
|
||||||
|
else if(control.hovered)
|
||||||
|
return UM.Theme.getColor("action_button_hovered_text");
|
||||||
|
else
|
||||||
|
return UM.Theme.getColor("action_button_text");
|
||||||
|
}
|
||||||
font: UM.Theme.getFont("action_button")
|
font: UM.Theme.getFont("action_button")
|
||||||
text: control.text;
|
text: control.text;
|
||||||
}
|
}
|
||||||
|
@ -167,12 +187,28 @@ Rectangle {
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
id: deviceSelectionIcon
|
id: deviceSelectionIcon
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
border.color: !control.enabled ? UM.Theme.getColor("action_button_disabled_border") :
|
border.color:
|
||||||
control.pressed ? UM.Theme.getColor("action_button_active_border") :
|
{
|
||||||
control.hovered ? UM.Theme.getColor("action_button_hovered_border") : UM.Theme.getColor("action_button_border")
|
if(!control.enabled)
|
||||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled") :
|
return UM.Theme.getColor("action_button_disabled_border");
|
||||||
control.pressed ? UM.Theme.getColor("action_button_active") :
|
else if(control.pressed)
|
||||||
control.hovered ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("action_button")
|
return UM.Theme.getColor("action_button_active_border");
|
||||||
|
else if(control.hovered)
|
||||||
|
return UM.Theme.getColor("action_button_hovered_border");
|
||||||
|
else
|
||||||
|
return UM.Theme.getColor("action_button_border");
|
||||||
|
}
|
||||||
|
color:
|
||||||
|
{
|
||||||
|
if(!control.enabled)
|
||||||
|
return UM.Theme.getColor("action_button_disabled");
|
||||||
|
else if(control.pressed)
|
||||||
|
return UM.Theme.getColor("action_button_active");
|
||||||
|
else if(control.hovered)
|
||||||
|
return UM.Theme.getColor("action_button_hovered");
|
||||||
|
else
|
||||||
|
return UM.Theme.getColor("action_button");
|
||||||
|
}
|
||||||
Behavior on color { ColorAnimation { duration: 50; } }
|
Behavior on color { ColorAnimation { duration: 50; } }
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: UM.Theme.getSize("save_button_text_margin").width / 2;
|
anchors.leftMargin: UM.Theme.getSize("save_button_text_margin").width / 2;
|
||||||
|
@ -186,9 +222,17 @@ Rectangle {
|
||||||
height: UM.Theme.getSize("standard_arrow").height
|
height: UM.Theme.getSize("standard_arrow").height
|
||||||
sourceSize.width: width
|
sourceSize.width: width
|
||||||
sourceSize.height: height
|
sourceSize.height: height
|
||||||
color: !control.enabled ? UM.Theme.getColor("action_button_disabled_text") :
|
color:
|
||||||
control.pressed ? UM.Theme.getColor("action_button_active_text") :
|
{
|
||||||
control.hovered ? UM.Theme.getColor("action_button_hovered_text") : UM.Theme.getColor("action_button_text");
|
if(!control.enabled)
|
||||||
|
return UM.Theme.getColor("action_button_disabled_text");
|
||||||
|
else if(control.pressed)
|
||||||
|
return UM.Theme.getColor("action_button_active_text");
|
||||||
|
else if(control.hovered)
|
||||||
|
return UM.Theme.getColor("action_button_hovered_text");
|
||||||
|
else
|
||||||
|
return UM.Theme.getColor("action_button_text");
|
||||||
|
}
|
||||||
source: UM.Theme.getIcon("arrow_bottom");
|
source: UM.Theme.getIcon("arrow_bottom");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue