mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 01:15:51 +08:00
Merge branch 'master' of github.com:Ultimaker/Cura
This commit is contained in:
commit
1ebd34ac1e
@ -226,58 +226,7 @@ Rectangle
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
style: ButtonStyle
|
style: UM.Theme.styles.sidebar_action_button
|
||||||
{
|
|
||||||
background: Rectangle
|
|
||||||
{
|
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
|
||||||
border.color:
|
|
||||||
{
|
|
||||||
if(!control.enabled)
|
|
||||||
return UM.Theme.getColor("action_button_disabled_border");
|
|
||||||
else if(control.pressed)
|
|
||||||
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; } }
|
|
||||||
|
|
||||||
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2)
|
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
id: actualLabel
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color:
|
|
||||||
{
|
|
||||||
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")
|
|
||||||
text: control.text
|
|
||||||
}
|
|
||||||
}
|
|
||||||
label: Item { }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Button
|
Button
|
||||||
@ -293,58 +242,7 @@ Rectangle
|
|||||||
text: catalog.i18nc("@label:", "Abort Print")
|
text: catalog.i18nc("@label:", "Abort Print")
|
||||||
onClicked: confirmationDialog.visible = true
|
onClicked: confirmationDialog.visible = true
|
||||||
|
|
||||||
style: ButtonStyle
|
style: UM.Theme.styles.sidebar_action_button
|
||||||
{
|
|
||||||
background: Rectangle
|
|
||||||
{
|
|
||||||
border.width: UM.Theme.getSize("default_lining").width
|
|
||||||
border.color:
|
|
||||||
{
|
|
||||||
if(!control.enabled)
|
|
||||||
return UM.Theme.getColor("action_button_disabled_border");
|
|
||||||
else if(control.pressed)
|
|
||||||
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; } }
|
|
||||||
|
|
||||||
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2)
|
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
id: actualLabel
|
|
||||||
anchors.centerIn: parent
|
|
||||||
color:
|
|
||||||
{
|
|
||||||
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")
|
|
||||||
text: control.text;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
label: Item { }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MessageDialog
|
MessageDialog
|
||||||
|
@ -123,7 +123,7 @@ UM.ManagementPage
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Row
|
Grid
|
||||||
{
|
{
|
||||||
id: machineInfo
|
id: machineInfo
|
||||||
|
|
||||||
@ -132,17 +132,71 @@ UM.ManagementPage
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
spacing: UM.Theme.getSize("default_margin").height
|
spacing: UM.Theme.getSize("default_margin").height
|
||||||
|
rowSpacing: UM.Theme.getSize("default_lining").height
|
||||||
|
columns: 2
|
||||||
|
|
||||||
visible: base.currentItem
|
visible: base.currentItem
|
||||||
|
|
||||||
|
property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0
|
||||||
|
property var connectedPrinter: printerConnected ? Cura.MachineManager.printerOutputDevices[0] : null
|
||||||
|
property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: catalog.i18nc("@label", "Type")
|
text: catalog.i18nc("@label", "Printer type:")
|
||||||
visible: base.currentItem && "definition_name" in base.currentItem.metadata
|
visible: base.currentItem && "definition_name" in base.currentItem.metadata
|
||||||
}
|
}
|
||||||
Label {
|
Label {
|
||||||
text: (base.currentItem && "definition_name" in base.currentItem.metadata) ? base.currentItem.metadata.definition_name : ""
|
text: (base.currentItem && "definition_name" in base.currentItem.metadata) ? base.currentItem.metadata.definition_name : ""
|
||||||
}
|
}
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
text: catalog.i18nc("@label", "Connection:")
|
||||||
|
visible: base.currentItem && base.currentItem.id == Cura.MachineManager.activeMachineId
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
width: parent.width * 0.7
|
||||||
|
text: machineInfo.printerConnected ? machineInfo.connectedPrinter.connectionText : catalog.i18nc("@info:status", "The printer is not connected.")
|
||||||
|
visible: base.currentItem && base.currentItem.id == Cura.MachineManager.activeMachineId
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
}
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
text: catalog.i18nc("@label", "State:")
|
||||||
|
visible: base.currentItem && base.currentItem.id == Cura.MachineManager.activeMachineId && machineInfo.printerAcceptsCommands
|
||||||
|
}
|
||||||
|
Label {
|
||||||
|
width: parent.width * 0.7
|
||||||
|
text:
|
||||||
|
{
|
||||||
|
if(!machineInfo.printerConnected || !machineInfo.printerAcceptsCommands) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
|
||||||
|
{
|
||||||
|
case "printing":
|
||||||
|
return catalog.i18nc("@label:MonitorStatus", "Printing...");
|
||||||
|
case "paused":
|
||||||
|
return catalog.i18nc("@label:MonitorStatus", "Paused");
|
||||||
|
case "pre_print":
|
||||||
|
return catalog.i18nc("@label:MonitorStatus", "Preparing...");
|
||||||
|
case "wait_cleanup":
|
||||||
|
return catalog.i18nc("@label:MonitorStatus", "Waiting for someone to clear the build plate");
|
||||||
|
case "error":
|
||||||
|
return printerOutputDevice.errorText;
|
||||||
|
case "maintenance": // note sure if this jobState actually occurs in the wild
|
||||||
|
return catalog.i18nc("@label:MonitorStatus", "Busy; please check the printer");
|
||||||
|
case "abort": // note sure if this jobState actually occurs in the wild
|
||||||
|
return catalog.i18nc("@label:MonitorStatus", "Aborting print...");
|
||||||
|
case "ready": // ready to print or getting ready
|
||||||
|
case "": // ready to print or getting ready
|
||||||
|
return catalog.i18nc("@label:MonitorStatus", "Waiting for a printjob");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
visible: base.currentItem && base.currentItem.id == Cura.MachineManager.activeMachineId && machineInfo.printerAcceptsCommands
|
||||||
|
wrapMode: Text.WordWrap
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
|
@ -18,7 +18,7 @@ Column
|
|||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: printerConnected ? connectedPrinter.connectionText : catalog.i18nc("@label", "The printer is not connected.")
|
text: printerConnected ? connectedPrinter.connectionText : catalog.i18nc("@info:status", "The printer is not connected.")
|
||||||
color: printerConnected && printerAcceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
color: printerConnected && printerAcceptsCommands ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text")
|
||||||
font: UM.Theme.getFont("default")
|
font: UM.Theme.getFont("default")
|
||||||
wrapMode: Text.WordWrap
|
wrapMode: Text.WordWrap
|
||||||
|
@ -506,4 +506,59 @@ QtObject {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property Component sidebar_action_button: Component {
|
||||||
|
ButtonStyle
|
||||||
|
{
|
||||||
|
background: Rectangle
|
||||||
|
{
|
||||||
|
border.width: UM.Theme.getSize("default_lining").width
|
||||||
|
border.color:
|
||||||
|
{
|
||||||
|
if(!control.enabled)
|
||||||
|
return UM.Theme.getColor("action_button_disabled_border");
|
||||||
|
else if(control.pressed)
|
||||||
|
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; } }
|
||||||
|
|
||||||
|
implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2)
|
||||||
|
|
||||||
|
Label
|
||||||
|
{
|
||||||
|
id: actualLabel
|
||||||
|
anchors.centerIn: parent
|
||||||
|
color:
|
||||||
|
{
|
||||||
|
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")
|
||||||
|
text: control.text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
label: Item { }
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user