From 26a41c37265822414c3b79e58acce3fc2765a51a Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 6 Dec 2018 11:45:14 +0100 Subject: [PATCH] Adjust the color of the printer in the printer selector For that I needed to get rid of the IconLabel component, since in this case the color of the icon and the text is the same (and it makes sense) --- .../qml/PrinterSelector/MachineSelector.qml | 57 +++++++++++++------ resources/themes/cura-light/theme.json | 1 + 2 files changed, 41 insertions(+), 17 deletions(-) diff --git a/resources/qml/PrinterSelector/MachineSelector.qml b/resources/qml/PrinterSelector/MachineSelector.qml index 91b5591cd8..95abfd6644 100644 --- a/resources/qml/PrinterSelector/MachineSelector.qml +++ b/resources/qml/PrinterSelector/MachineSelector.qml @@ -25,29 +25,52 @@ Cura.ExpandableComponent name: "cura" } - headerItem: Cura.IconLabel + headerItem: Item { - text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName - source: - { - if (isNetworkPrinter) - { - if (machineSelector.outputDevice != null && machineSelector.outputDevice.clusterSize > 1) - { - return UM.Theme.getIcon("printer_group") - } - return UM.Theme.getIcon("printer_single") - } - return "" - } - font: UM.Theme.getFont("medium") - color: UM.Theme.getColor("text") - iconSize: UM.Theme.getSize("machine_selector_icon").width + implicitHeight: icon.height UM.RecolorImage { id: icon + anchors.left: parent.left + anchors.verticalCenter: parent.verticalCenter + + source: + { + if (isNetworkPrinter) + { + if (machineSelector.outputDevice != null && machineSelector.outputDevice.clusterSize > 1) + { + return UM.Theme.getIcon("printer_group") + } + return UM.Theme.getIcon("printer_single") + } + return "" + } + width: UM.Theme.getSize("machine_selector_icon").width + height: width + + color: UM.Theme.getColor("machine_selector_printer_icon") + visible: source != "" + } + + Label + { + id: label + anchors.left: icon.visible ? icon.right : parent.left + anchors.right: parent.right + anchors.leftMargin: UM.Theme.getSize("thin_margin").width + anchors.verticalCenter: icon.verticalCenter + text: isNetworkPrinter ? Cura.MachineManager.activeMachineNetworkGroupName : Cura.MachineManager.activeMachineName + elide: Text.ElideRight + color: UM.Theme.getColor("text") + font: UM.Theme.getFont("medium") + renderType: Text.NativeRendering + } + + UM.RecolorImage + { anchors { bottom: parent.bottom diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index a4ed45fb24..2d7e92be4d 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -108,6 +108,7 @@ "machine_selector_active": [68, 72, 75, 255], "machine_selector_hover": [68, 72, 75, 255], "machine_selector_text_active": [255, 255, 255, 255], + "machine_selector_printer_icon": [8, 7, 63, 255], "action_panel_secondary": [27, 95, 202, 255],