mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 16:28:59 +08:00
Fix merge conflict for topbar monitor button
CURA-4106
This commit is contained in:
parent
3e3f15d33f
commit
3f6f4a1291
@ -73,75 +73,8 @@ Rectangle
|
|||||||
height: UM.Theme.getSize("sidebar_header").height
|
height: UM.Theme.getSize("sidebar_header").height
|
||||||
onClicked: base.startMonitoringPrint()
|
onClicked: base.startMonitoringPrint()
|
||||||
text: catalog.i18nc("@title:tab", "Monitor")
|
text: catalog.i18nc("@title:tab", "Monitor")
|
||||||
property color overlayColor: "transparent"
|
iconSource: UM.Theme.getIcon("tab_monitor")
|
||||||
property string overlayIconSource: ""
|
property color overlayColor:
|
||||||
checkable: true
|
|
||||||
checked: base.monitoringPrint
|
|
||||||
exclusiveGroup: sidebarHeaderBarGroup
|
|
||||||
|
|
||||||
style: UM.Theme.styles.topbar_header_tab
|
|
||||||
}
|
|
||||||
|
|
||||||
ExclusiveGroup { id: sidebarHeaderBarGroup }
|
|
||||||
}
|
|
||||||
|
|
||||||
UM.RecolorImage
|
|
||||||
{
|
|
||||||
id: machineIcon
|
|
||||||
width: UM.Theme.getSize("button_icon").width //TODO: Once the light design is merged, the theme defines a different size for the top bar icons.
|
|
||||||
height: UM.Theme.getSize("button_icon").height
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.right: machineSelection.left
|
|
||||||
anchors.rightMargin: UM.Theme.getSize("default_margin").width //TODO: With the light design comes a different margin here.
|
|
||||||
|
|
||||||
source: printerConnected ? UM.Theme.getIcon("tab_monitor_with_status") : UM.Theme.getIcon("tab_monitor")
|
|
||||||
}
|
|
||||||
|
|
||||||
UM.RecolorImage
|
|
||||||
{
|
|
||||||
id: machineStatusIcon
|
|
||||||
width: machineIcon.width
|
|
||||||
height: machineIcon.height
|
|
||||||
anchors.fill: machineIcon
|
|
||||||
|
|
||||||
source:
|
|
||||||
{
|
|
||||||
if(!printerConnected)
|
|
||||||
{
|
|
||||||
return "";
|
|
||||||
}
|
|
||||||
else if(!printerAcceptsCommands)
|
|
||||||
{
|
|
||||||
return UM.Theme.getIcon("tab_status_unknown");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance")
|
|
||||||
{
|
|
||||||
return UM.Theme.getIcon("tab_status_busy");
|
|
||||||
}
|
|
||||||
|
|
||||||
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
|
|
||||||
{
|
|
||||||
case "printing":
|
|
||||||
case "pre_print":
|
|
||||||
case "wait_cleanup":
|
|
||||||
case "pausing":
|
|
||||||
case "resuming":
|
|
||||||
return UM.Theme.getIcon("tab_status_busy");
|
|
||||||
case "ready":
|
|
||||||
case "":
|
|
||||||
return UM.Theme.getIcon("tab_status_connected")
|
|
||||||
case "paused":
|
|
||||||
return UM.Theme.getIcon("tab_status_paused")
|
|
||||||
case "error":
|
|
||||||
return UM.Theme.getIcon("tab_status_stopped")
|
|
||||||
case "offline":
|
|
||||||
return UM.Theme.getIcon("tab_status_offline")
|
|
||||||
default:
|
|
||||||
return ""
|
|
||||||
}
|
|
||||||
}
|
|
||||||
color: //TODO: In the light design, this is no longer coloured but takes the colour from the SVG icon.
|
|
||||||
{
|
{
|
||||||
if(!printerAcceptsCommands)
|
if(!printerAcceptsCommands)
|
||||||
{
|
{
|
||||||
@ -173,14 +106,59 @@ Rectangle
|
|||||||
return UM.Theme.getColor("text_reversed");
|
return UM.Theme.getColor("text_reversed");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
property string overlayIconSource:
|
||||||
|
{
|
||||||
|
if(!printerConnected)
|
||||||
|
{
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
|
else if(!printerAcceptsCommands)
|
||||||
|
{
|
||||||
|
return UM.Theme.getIcon("tab_status_unknown");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance")
|
||||||
|
{
|
||||||
|
return UM.Theme.getIcon("tab_status_busy");
|
||||||
|
}
|
||||||
|
|
||||||
|
switch(Cura.MachineManager.printerOutputDevices[0].jobState)
|
||||||
|
{
|
||||||
|
case "printing":
|
||||||
|
case "pre_print":
|
||||||
|
case "wait_cleanup":
|
||||||
|
case "pausing":
|
||||||
|
case "resuming":
|
||||||
|
return UM.Theme.getIcon("tab_status_busy");
|
||||||
|
case "ready":
|
||||||
|
case "":
|
||||||
|
return UM.Theme.getIcon("tab_status_connected")
|
||||||
|
case "paused":
|
||||||
|
return UM.Theme.getIcon("tab_status_paused")
|
||||||
|
case "error":
|
||||||
|
return UM.Theme.getIcon("tab_status_stopped")
|
||||||
|
default:
|
||||||
|
return ""
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
checkable: true
|
||||||
|
checked: base.monitoringPrint
|
||||||
|
exclusiveGroup: sidebarHeaderBarGroup
|
||||||
|
|
||||||
|
style: UM.Theme.styles.topbar_header_tab
|
||||||
|
}
|
||||||
|
|
||||||
|
ExclusiveGroup { id: sidebarHeaderBarGroup }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
ToolButton
|
ToolButton
|
||||||
{
|
{
|
||||||
id: machineSelection
|
id: machineSelection
|
||||||
text: Cura.MachineManager.activeMachineName
|
text: Cura.MachineManager.activeMachineName
|
||||||
|
|
||||||
width: UM.Theme.getSize("sidebar").width - machineIcon.width - UM.Theme.getSize("default_margin").width * 2 //TODO: The light design has a different margin here.
|
width: UM.Theme.getSize("sidebar").width
|
||||||
height: UM.Theme.getSize("sidebar_header").height
|
height: UM.Theme.getSize("sidebar_header").height
|
||||||
tooltip: Cura.MachineManager.activeMachineName
|
tooltip: Cura.MachineManager.activeMachineName
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user