diff --git a/plugins/MonitorStage/MonitorStage.py b/plugins/MonitorStage/MonitorStage.py index 6131e5538b..dd1eca9682 100644 --- a/plugins/MonitorStage/MonitorStage.py +++ b/plugins/MonitorStage/MonitorStage.py @@ -19,3 +19,40 @@ class MonitorStage(CuraStage): sidebar_component_path = os.path.join(Resources.getPath(Application.getInstance().ResourceTypes.QmlFiles), "Sidebar.qml") self.addDisplayComponent("sidebar", sidebar_component_path) self.setIconSource(Application.getInstance().getTheme().getIcon("tab_status_connected")) + +# property string iconSource: +# // { +# // if (!printerConnected) +# // { +# // return UM.Theme.getIcon("tab_status_unknown"); +# // } +# // 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 "pausing": +# // case "resuming": +# // return UM.Theme.getIcon("tab_status_busy"); +# // case "wait_cleanup": +# // return UM.Theme.getIcon("tab_status_finished"); +# // 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 UM.Theme.getIcon("tab_status_unknown") +# // } +# // } \ No newline at end of file diff --git a/resources/qml/Topbar.qml b/resources/qml/Topbar.qml index 550b2dc007..98f9f94528 100644 --- a/resources/qml/Topbar.qml +++ b/resources/qml/Topbar.qml @@ -16,7 +16,7 @@ Rectangle anchors.left: parent.left anchors.right: parent.right height: UM.Theme.getSize("sidebar_header").height - color: UM.Controller.activeStage.id == "MonitorStage" ? UM.Theme.getColor("topbar_background_color_monitoring") : UM.Theme.getColor("topbar_background_color") + color: UM.Controller.activeStage.stageId == "MonitorStage" ? UM.Theme.getColor("topbar_background_color_monitoring") : UM.Theme.getColor("topbar_background_color") property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0 property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands @@ -87,66 +87,6 @@ Rectangle } ExclusiveGroup { id: topbarMenuGroup } - -// Button -// { -// id: showMonitor -// width: UM.Theme.getSize("topbar_button").width -// height: UM.Theme.getSize("sidebar_header").height -// text: catalog.i18nc("@title:tab", "Monitor") -// checkable: true -// checked: isChecked() -// exclusiveGroup: sidebarHeaderBarGroup -// style: UM.Theme.styles.topbar_header_tab_no_overlay -// -// // We use a Qt.binding to re-bind the checkbox state after manually setting it -// // https://stackoverflow.com/questions/38798450/qt-5-7-qml-why-are-my-checkbox-property-bindings-disappearing -// onClicked: { -// base.startMonitoringPrint() -// checked = Qt.binding(isChecked) -// } -// -// function isChecked () { -// return base.monitoringPrint -// } -// -// property string iconSource: -// { -// if (!printerConnected) -// { -// return UM.Theme.getIcon("tab_status_unknown"); -// } -// 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 "pausing": -// case "resuming": -// return UM.Theme.getIcon("tab_status_busy"); -// case "wait_cleanup": -// return UM.Theme.getIcon("tab_status_finished"); -// 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 UM.Theme.getIcon("tab_status_unknown") -// } -// } -// } } ToolButton