From e2a9fc0d797f8fe339f9c1d38372a53f87b0d3ef Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Thu, 26 Jan 2017 14:32:47 +0100 Subject: [PATCH] Rename header tab status overlays to make them reusable The "settings" tab could use a status overlay to show setting errors and slicing paused states. --- resources/qml/Sidebar.qml | 31 ++++++++++++++----- ...b_monitor_busy.svg => tab_status_busy.svg} | 0 ...connected.svg => tab_status_connected.svg} | 0 ...tor_offline.svg => tab_status_offline.svg} | 0 ...nitor_paused.svg => tab_status_paused.svg} | 0 ...tor_stopped.svg => tab_status_stopped.svg} | 0 ...tor_unknown.svg => tab_status_unknown.svg} | 0 resources/themes/cura/theme.json | 1 + 8 files changed, 24 insertions(+), 8 deletions(-) rename resources/themes/cura/icons/{tab_monitor_busy.svg => tab_status_busy.svg} (100%) rename resources/themes/cura/icons/{tab_monitor_connected.svg => tab_status_connected.svg} (100%) rename resources/themes/cura/icons/{tab_monitor_offline.svg => tab_status_offline.svg} (100%) rename resources/themes/cura/icons/{tab_monitor_paused.svg => tab_status_paused.svg} (100%) rename resources/themes/cura/icons/{tab_monitor_stopped.svg => tab_status_stopped.svg} (100%) rename resources/themes/cura/icons/{tab_monitor_unknown.svg => tab_status_unknown.svg} (100%) diff --git a/resources/qml/Sidebar.qml b/resources/qml/Sidebar.qml index 7803c3eec9..148606679f 100644 --- a/resources/qml/Sidebar.qml +++ b/resources/qml/Sidebar.qml @@ -209,6 +209,15 @@ Rectangle 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.getColor("status_busy"); + } switch(Cura.MachineManager.printerOutputDevices[0].jobState) { case "printing": @@ -233,13 +242,17 @@ Rectangle property string overlayIconSource: { if(!printerConnected) + { return ""; + } else if(!printerAcceptsCommands) - return UM.Theme.getIcon("tab_monitor_unknown"); + { + return UM.Theme.getIcon("tab_status_unknown"); + } if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") { - return UM.Theme.getIcon("tab_monitor_busy"); + return UM.Theme.getIcon("tab_status_busy"); } switch(Cura.MachineManager.printerOutputDevices[0].jobState) @@ -247,18 +260,20 @@ 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 "" } } diff --git a/resources/themes/cura/icons/tab_monitor_busy.svg b/resources/themes/cura/icons/tab_status_busy.svg similarity index 100% rename from resources/themes/cura/icons/tab_monitor_busy.svg rename to resources/themes/cura/icons/tab_status_busy.svg diff --git a/resources/themes/cura/icons/tab_monitor_connected.svg b/resources/themes/cura/icons/tab_status_connected.svg similarity index 100% rename from resources/themes/cura/icons/tab_monitor_connected.svg rename to resources/themes/cura/icons/tab_status_connected.svg diff --git a/resources/themes/cura/icons/tab_monitor_offline.svg b/resources/themes/cura/icons/tab_status_offline.svg similarity index 100% rename from resources/themes/cura/icons/tab_monitor_offline.svg rename to resources/themes/cura/icons/tab_status_offline.svg diff --git a/resources/themes/cura/icons/tab_monitor_paused.svg b/resources/themes/cura/icons/tab_status_paused.svg similarity index 100% rename from resources/themes/cura/icons/tab_monitor_paused.svg rename to resources/themes/cura/icons/tab_status_paused.svg diff --git a/resources/themes/cura/icons/tab_monitor_stopped.svg b/resources/themes/cura/icons/tab_status_stopped.svg similarity index 100% rename from resources/themes/cura/icons/tab_monitor_stopped.svg rename to resources/themes/cura/icons/tab_status_stopped.svg diff --git a/resources/themes/cura/icons/tab_monitor_unknown.svg b/resources/themes/cura/icons/tab_status_unknown.svg similarity index 100% rename from resources/themes/cura/icons/tab_monitor_unknown.svg rename to resources/themes/cura/icons/tab_status_unknown.svg 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],