diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index d27569c6b8..148606679f 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -175,6 +175,9 @@ Rectangle height: UM.Theme.getSize("sidebar_header").height onClicked: monitoringPrint = false iconSource: UM.Theme.getIcon("tab_settings"); + property color overlayColor: "transparent" + property string overlayIconSource: "" + checkable: true checked: !monitoringPrint exclusiveGroup: sidebarHeaderBarGroup @@ -203,15 +206,53 @@ Rectangle width: height height: UM.Theme.getSize("sidebar_header").height onClicked: monitoringPrint = true - iconSource: { - if(!printerConnected) - return UM.Theme.getIcon("tab_monitor"); - else if(!printerAcceptsCommands) - return UM.Theme.getIcon("tab_monitor_unknown"); + iconSource: printerConnected ? UM.Theme.getIcon("tab_monitor_with_status") : UM.Theme.getIcon("tab_monitor") + property color overlayColor: + { + if(!printerAcceptsCommands) + { + return UM.Theme.getColor("status_unknown"); + } if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") { - return UM.Theme.getIcon("tab_monitor_busy"); + return UM.Theme.getColor("status_busy"); + } + switch(Cura.MachineManager.printerOutputDevices[0].jobState) + { + case "printing": + case "pre_print": + case "wait_cleanup": + case "pausing": + case "resuming": + return UM.Theme.getColor("status_busy"); + case "ready": + case "": + return UM.Theme.getColor("status_ready"); + case "paused": + return UM.Theme.getColor("status_paused"); + case "error": + return UM.Theme.getColor("status_stopped"); + case "offline": + return UM.Theme.getColor("status_offline"); + default: + 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) @@ -219,20 +260,23 @@ Rectangle case "printing": case "pre_print": case "wait_cleanup": - return UM.Theme.getIcon("tab_monitor_busy"); + case "pausing": + case "resuming": + return UM.Theme.getIcon("tab_status_busy"); case "ready": case "": - return UM.Theme.getIcon("tab_monitor_connected") + return UM.Theme.getIcon("tab_status_connected") case "paused": - return UM.Theme.getIcon("tab_monitor_paused") + return UM.Theme.getIcon("tab_status_paused") case "error": - return UM.Theme.getIcon("tab_monitor_stopped") + return UM.Theme.getIcon("tab_status_stopped") case "offline": - return UM.Theme.getIcon("tab_monitor_offline") + return UM.Theme.getIcon("tab_status_offline") default: - return UM.Theme.getIcon("tab_monitor") + return "" } } + checkable: true checked: monitoringPrint exclusiveGroup: sidebarHeaderBarGroup diff --git a/resources/themes/cura/icons/tab_monitor.svg b/resources/themes/cura/icons/tab_monitor.svg index 9658a6af5f..2677cec6e2 100644 --- a/resources/themes/cura/icons/tab_monitor.svg +++ b/resources/themes/cura/icons/tab_monitor.svg @@ -1,3 +1,3 @@ - + diff --git a/resources/themes/cura/icons/tab_monitor_busy.svg b/resources/themes/cura/icons/tab_monitor_busy.svg deleted file mode 100644 index 84ab2e23f1..0000000000 --- a/resources/themes/cura/icons/tab_monitor_busy.svg +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/resources/themes/cura/icons/tab_monitor_connected.svg b/resources/themes/cura/icons/tab_monitor_connected.svg deleted file mode 100644 index ef2bfbf8f5..0000000000 --- a/resources/themes/cura/icons/tab_monitor_connected.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/resources/themes/cura/icons/tab_monitor_offline.svg b/resources/themes/cura/icons/tab_monitor_offline.svg deleted file mode 100644 index 4a16d5a559..0000000000 --- a/resources/themes/cura/icons/tab_monitor_offline.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/resources/themes/cura/icons/tab_monitor_stopped.svg b/resources/themes/cura/icons/tab_monitor_stopped.svg deleted file mode 100644 index 6f63c7c2db..0000000000 --- a/resources/themes/cura/icons/tab_monitor_stopped.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/resources/themes/cura/icons/tab_monitor_unknown.svg b/resources/themes/cura/icons/tab_monitor_unknown.svg deleted file mode 100644 index 3d798c7e27..0000000000 --- a/resources/themes/cura/icons/tab_monitor_unknown.svg +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/resources/themes/cura/icons/tab_monitor_paused.svg b/resources/themes/cura/icons/tab_monitor_with_status.svg similarity index 74% rename from resources/themes/cura/icons/tab_monitor_paused.svg rename to resources/themes/cura/icons/tab_monitor_with_status.svg index 10cdc9a2a3..dc3b373313 100644 --- a/resources/themes/cura/icons/tab_monitor_paused.svg +++ b/resources/themes/cura/icons/tab_monitor_with_status.svg @@ -1,5 +1,4 @@ - - - + + diff --git a/resources/themes/cura/icons/tab_status_busy.svg b/resources/themes/cura/icons/tab_status_busy.svg new file mode 100644 index 0000000000..cb72fdd623 --- /dev/null +++ b/resources/themes/cura/icons/tab_status_busy.svg @@ -0,0 +1,4 @@ + + + diff --git a/resources/themes/cura/icons/tab_status_connected.svg b/resources/themes/cura/icons/tab_status_connected.svg new file mode 100644 index 0000000000..16ec7d7523 --- /dev/null +++ b/resources/themes/cura/icons/tab_status_connected.svg @@ -0,0 +1,4 @@ + + + diff --git a/resources/themes/cura/icons/tab_status_offline.svg b/resources/themes/cura/icons/tab_status_offline.svg new file mode 100644 index 0000000000..850ca1bc03 --- /dev/null +++ b/resources/themes/cura/icons/tab_status_offline.svg @@ -0,0 +1,4 @@ + + + diff --git a/resources/themes/cura/icons/tab_status_paused.svg b/resources/themes/cura/icons/tab_status_paused.svg new file mode 100644 index 0000000000..feffb7894c --- /dev/null +++ b/resources/themes/cura/icons/tab_status_paused.svg @@ -0,0 +1,4 @@ + + + diff --git a/resources/themes/cura/icons/tab_status_stopped.svg b/resources/themes/cura/icons/tab_status_stopped.svg new file mode 100644 index 0000000000..86386d3a6b --- /dev/null +++ b/resources/themes/cura/icons/tab_status_stopped.svg @@ -0,0 +1,51 @@ + + + + + + image/svg+xml + + + + + + + + diff --git a/resources/themes/cura/icons/tab_status_unknown.svg b/resources/themes/cura/icons/tab_status_unknown.svg new file mode 100644 index 0000000000..1033b39a4c --- /dev/null +++ b/resources/themes/cura/icons/tab_status_unknown.svg @@ -0,0 +1,4 @@ + + + diff --git a/resources/themes/cura/styles.qml b/resources/themes/cura/styles.qml index a57f60b387..64b4436622 100644 --- a/resources/themes/cura/styles.qml +++ b/resources/themes/cura/styles.qml @@ -100,12 +100,24 @@ QtObject { } label: Item { - Image { - anchors.centerIn: parent; + UM.RecolorImage { + color: UM.Theme.getColor("text_reversed") + anchors.centerIn: parent opacity: !control.enabled ? 0.2 : 1.0 - source: control.iconSource; - width: Theme.getSize("button_icon").width; - height: Theme.getSize("button_icon").height; + source: control.iconSource + width: Theme.getSize("button_icon").width + height: Theme.getSize("button_icon").height + + sourceSize: Theme.getSize("button_icon") + } + UM.RecolorImage { + visible: control.overlayIconSource != "" + color: control.overlayColor + anchors.centerIn: parent + opacity: !control.enabled ? 0.2 : 1.0 + source: control.overlayIconSource + width: Theme.getSize("button_icon").width + height: Theme.getSize("button_icon").height sourceSize: Theme.getSize("button_icon") } diff --git a/resources/themes/cura/theme.json b/resources/themes/cura/theme.json index 31caeeabd4..23ebacd7f9 100644 --- a/resources/themes/cura/theme.json +++ b/resources/themes/cura/theme.json @@ -193,6 +193,7 @@ "status_busy": [12, 169, 227, 255], "status_paused": [255, 140, 0, 255], "status_stopped": [236, 82, 80, 255], + "status_unknown": [127, 127, 127, 255], "disabled_axis": [127, 127, 127, 255], "x_axis": [255, 0, 0, 255],