diff --git a/resources/qml/Topbar.qml b/resources/qml/Topbar.qml index 799942f0f6..930cc7c4bf 100644 --- a/resources/qml/Topbar.qml +++ b/resources/qml/Topbar.qml @@ -16,13 +16,16 @@ Rectangle anchors.left: parent.left anchors.right: parent.right height: UM.Theme.getSize("sidebar_header").height - color: "transparent" + color: base.monitoringPrint ? UM.Theme.getColor("topbar_background_color_monitoring") : UM.Theme.getColor("topbar_background_color") + + Behavior on color { ColorAnimation { duration: 100; } } property bool printerConnected: Cura.MachineManager.printerOutputDevices.length != 0 property bool printerAcceptsCommands: printerConnected && Cura.MachineManager.printerOutputDevices[0].acceptsCommands property bool monitoringPrint: false signal startMonitoringPrint() signal stopMonitoringPrint() + UM.I18nCatalog { id: catalog @@ -76,21 +79,21 @@ Rectangle text: catalog.i18nc("@title:tab", "Monitor") property string iconSource: { - if(!printerConnected) + if (!printerConnected) { return UM.Theme.getIcon("tab_status_unknown"); } - else if(!printerAcceptsCommands) + else if (!printerAcceptsCommands) { return UM.Theme.getIcon("tab_status_unknown"); } - if(Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") + if (Cura.MachineManager.printerOutputDevices[0].printerState == "maintenance") { return UM.Theme.getIcon("tab_status_busy"); } - switch(Cura.MachineManager.printerOutputDevices[0].jobState) + switch (Cura.MachineManager.printerOutputDevices[0].jobState) { case "printing": case "pre_print": @@ -121,7 +124,6 @@ Rectangle ExclusiveGroup { id: sidebarHeaderBarGroup } } - ToolButton { id: machineSelection @@ -142,10 +144,12 @@ Rectangle if(control.pressed) { return UM.Theme.getColor("sidebar_header_active"); - } else if(control.hovered) + } + else if(control.hovered) { return UM.Theme.getColor("sidebar_header_hover"); - } else + } + else { return UM.Theme.getColor("sidebar_header_bar"); } @@ -207,12 +211,15 @@ Rectangle rightMargin: UM.Theme.getSize("sidebar").width + UM.Theme.getSize("default_margin").width } style: UM.Theme.styles.combobox + visible: !base.monitoringPrint model: UM.ViewModel { } textRole: "name" + onCurrentIndexChanged: { UM.Controller.setActiveView(model.getItem(currentIndex).id); + // Update the active flag for (var i = 0; i < model.rowCount; ++i) { @@ -220,6 +227,7 @@ Rectangle model.getItem(i).active = is_active; } } + currentIndex: { for (var i = 0; i < model.rowCount; ++i) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index bbdfd0eaf8..d727425795 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -67,6 +67,9 @@ "border": [127, 127, 127, 255], "secondary": [245, 245, 245, 255], + "topbar_background_color": [255, 255, 255, 0], + "topbar_background_color_monitoring": [255, 255, 255, 255], + "topbar_button_text_active": [0, 0, 0, 255], "topbar_button_text_inactive": [128, 128, 128, 255], "topbar_button_text_hovered": [0, 0, 0, 255],