From 02a6cc6e1d69ae6034596073c18c167a5281c880 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 16 Feb 2022 23:43:54 +0100 Subject: [PATCH 01/35] Improve visual appearance of `ColorDialog` According to the figma design CURA-8938 --- resources/qml/ColorDialog.qml | 131 ++++++++++++++++++++++++---------- 1 file changed, 94 insertions(+), 37 deletions(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 358e8b9ef5..fd19542b43 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -17,61 +17,118 @@ UM.Dialog property variant catalog: UM.I18nCatalog { name: "cura" } - minimumHeight: UM.Theme.getSize("small_popup_dialog").height - minimumWidth: UM.Theme.getSize("small_popup_dialog").width / 1.5 - height: minimumHeight - width: minimumWidth + margin: UM.Theme.getSize("wide_margin").width property alias color: colorInput.text + property var defaultColors: [ + "#2161AF", "#57AFB2", "#F7B32D", "#E33D4A", "#C088AD", + "#5D88BE", "#5ABD0E", "#E17239", "#F74E46", "#874AF9", + "#50C2EC", "#8DC15A", "#C3977A", "#CD7776", "#9086BA", + "#FFFFFF", "#D3D3D3", "#9E9E9E", "#5A5A5A", "#000000", + ] - margin: UM.Theme.getSize("default_margin").width - buttonSpacing: UM.Theme.getSize("default_margin").width - - UM.Label + Component.onCompleted: { - id: colorLabel - font: UM.Theme.getFont("large") - text: catalog.i18nc("@label", "Color Code (HEX)") + for (let i = 0; i < base.defaultColors.length; i ++) + { + const swatchColor = base.defaultColors[i]; + defaultColorsModel.append({ swatchColor }); + } } - TextField + Column { - id: colorInput - text: "#FFFFFF" - selectByMouse: true - anchors.top: colorLabel.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height - onTextChanged: { - if (!text.startsWith("#")) + id: content + width: childrenRect.width + height: childrenRect.height + spacing: UM.Theme.getSize("wide_margin").height + + GridLayout { + columns: 5 + width: childrenRect.width + height: childrenRect.height + columnSpacing: UM.Theme.getSize("thick_margin").width + rowSpacing: UM.Theme.getSize("thick_margin").height + + Repeater { - text = `#${text}`; + model: ListModel + { + id: defaultColorsModel + } + + delegate: Rectangle + { + color: swatchColor + width: 24 + height: 24 + radius: width / 2 + + UM.RecolorImage + { + anchors.fill: parent + visible: swatchColor == base.color + source: UM.Theme.getIcon("Check", "low") + color: UM.Theme.getColor("checkbox") + } + + MouseArea + { + anchors.fill: parent + onClicked: + { + base.color = swatchColor; + } + } + } + } + } + + RowLayout + { + width: parent.width + spacing: UM.Theme.getSize("default_margin").width + + UM.Label + { + text: catalog.i18nc("@label", "Hex") + } + + TextField + { + id: colorInput + Layout.fillWidth: true + text: "#FFFFFF" + selectByMouse: true + onTextChanged: { + if (!text.startsWith("#")) + { + text = `#${text}`; + } + } + validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{0,6})$/ } + } + + Rectangle + { + color: base.color + Layout.preferredHeight: parent.height + Layout.preferredWidth: height } } - validator: RegExpValidator { regExp: /^#([a-fA-F0-9]{0,6})$/ } } - Rectangle - { - id: swatch - color: base.color - anchors.leftMargin: UM.Theme.getSize("default_margin").width - anchors { - left: colorInput.right - top: colorInput.top - bottom: colorInput.bottom - } - width: height - } + buttonSpacing: UM.Theme.getSize("default_margin").width rightButtons: [ + Cura.TertiaryButton { + text: catalog.i18nc("@action:button", "Cancel") + onClicked: base.close() + }, Cura.PrimaryButton { text: catalog.i18nc("@action:button", "OK") onClicked: base.accept() - }, - Cura.SecondaryButton { - text: catalog.i18nc("@action:button", "Cancel") - onClicked: base.close() } ] } \ No newline at end of file From 0786ff2c6bc2a4a8dd7f25cfec475b0a74a06323 Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 17 Feb 2022 09:50:38 +0100 Subject: [PATCH 02/35] Change variable names "swatch" is a more descriptive variable name for this usecase CURA-8938 --- resources/qml/ColorDialog.qml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index fd19542b43..f163211f53 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -20,7 +20,7 @@ UM.Dialog margin: UM.Theme.getSize("wide_margin").width property alias color: colorInput.text - property var defaultColors: [ + property var swatchColors: [ "#2161AF", "#57AFB2", "#F7B32D", "#E33D4A", "#C088AD", "#5D88BE", "#5ABD0E", "#E17239", "#F74E46", "#874AF9", "#50C2EC", "#8DC15A", "#C3977A", "#CD7776", "#9086BA", @@ -29,10 +29,9 @@ UM.Dialog Component.onCompleted: { - for (let i = 0; i < base.defaultColors.length; i ++) + for (let i = 0; i < base.swatchColors.length; i ++) { - const swatchColor = base.defaultColors[i]; - defaultColorsModel.append({ swatchColor }); + swatchColorsModel.append({ swatchColor: base.swatchColors[i] }); } } @@ -54,7 +53,7 @@ UM.Dialog { model: ListModel { - id: defaultColorsModel + id: swatchColorsModel } delegate: Rectangle From 301d68ebf2a77fa50f483170b0fa8191cc3b6a96 Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 24 Feb 2022 15:42:27 +0100 Subject: [PATCH 03/35] Update swatches on swatch color property changed CURA-8938 --- resources/qml/ColorDialog.qml | 10 +++++++--- .../qml/Preferences/Materials/MaterialsView.qml | 17 ++++++++++++++++- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index f163211f53..afb7b324a3 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -27,11 +27,15 @@ UM.Dialog "#FFFFFF", "#D3D3D3", "#9E9E9E", "#5A5A5A", "#000000", ] - Component.onCompleted: + Component.onCompleted: updateSwatches() + onSwatchColorsChanged: updateSwatches() + + function updateSwatches() { - for (let i = 0; i < base.swatchColors.length; i ++) + swatchColorsModel.clear(); + for (const swatchColor of base.swatchColors) { - swatchColorsModel.append({ swatchColor: base.swatchColors[i] }); + swatchColorsModel.append({ swatchColor }); } } diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 6d153f5960..97f0ce4de1 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -222,7 +222,22 @@ Item id: colorDialog title: catalog.i18nc("@title", "Material color picker") color: properties.color_code - onAccepted: base.setMetaDataEntry("color_code", properties.color_code, color) +// swatchColors: ["#2161AF", "#57AFB2", "#F7B32D", "#E33D4A", "#C088AD"] + onAccepted: { + base.setMetaDataEntry("color_code", properties.color_code, color); + console.log("color_code"); + + const timer = Qt.createQmlObject("import QtQuick 2.0; Timer {}", base); + timer.interval = 10000; + timer.repeat = true; + timer.triggered.connect(function () { + console.log("updating colors"); + colorDialog.swatchColors = ["#2161AF", "#57AFB2", "#F7B32D", "#E33D4A", "#C088AD"]; + }) + + console.log("starting timers"); + timer.start(); + } } } From 9b06849955bc30b2ab552d06845fa6f8fa93d0f6 Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 24 Feb 2022 15:43:22 +0100 Subject: [PATCH 04/35] Let the content of the color dialog determine the size of the dialog CURA-8938 --- resources/qml/ColorDialog.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index afb7b324a3..1f83f0ceda 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -17,7 +17,14 @@ UM.Dialog property variant catalog: UM.I18nCatalog { name: "cura" } - margin: UM.Theme.getSize("wide_margin").width + // In this case we would like to let the content of the dialog determine the size of the dialog + // however with the current implementation of the dialog this is not possible, so instead we calculate + // the size of the dialog ourselves. + minimumWidth: content.width + 2 * margin + minimumHeight: + content.height // content height + + buttonRow.height // button row height + + 3 * margin // top and bottom margin and margin between buttons and content property alias color: colorInput.text property var swatchColors: [ From 7dbe5c0f7ccd18f09b21f1a3d1b96ed2c8fa15ba Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 24 Feb 2022 15:44:46 +0100 Subject: [PATCH 05/35] Change some margins CURA-8938 --- resources/qml/ColorDialog.qml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 1f83f0ceda..09045581e4 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -17,6 +17,8 @@ UM.Dialog property variant catalog: UM.I18nCatalog { name: "cura" } + margin: UM.Theme.getSize("default_margin").width + // In this case we would like to let the content of the dialog determine the size of the dialog // however with the current implementation of the dialog this is not possible, so instead we calculate // the size of the dialog ourselves. @@ -128,7 +130,7 @@ UM.Dialog } } - buttonSpacing: UM.Theme.getSize("default_margin").width + buttonSpacing: UM.Theme.getSize("thin_margin").width rightButtons: [ From 2761aed4556e1292483f0acd9356d232456f977a Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 24 Feb 2022 15:45:10 +0100 Subject: [PATCH 06/35] Make number of columns configurable in color dialog CURA-8938 --- resources/qml/ColorDialog.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 09045581e4..646d23c209 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -19,6 +19,8 @@ UM.Dialog margin: UM.Theme.getSize("default_margin").width + property alias swatchGridColumns: colorSwatchGrid.columns + // In this case we would like to let the content of the dialog determine the size of the dialog // however with the current implementation of the dialog this is not possible, so instead we calculate // the size of the dialog ourselves. @@ -56,6 +58,7 @@ UM.Dialog spacing: UM.Theme.getSize("wide_margin").height GridLayout { + id: colorSwatchGrid columns: 5 width: childrenRect.width height: childrenRect.height From 60c91b56800e8df23c775e233667bca6a68b6cfb Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 24 Feb 2022 16:31:32 +0100 Subject: [PATCH 07/35] Fix crash when visible_settings is missing from pre-4.8 project files Found this while testing the new Qt interface. --- .../VersionUpgrade48to49/VersionUpgrade48to49.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py b/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py index 4595e66ed3..14db98c1fc 100644 --- a/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py +++ b/plugins/VersionUpgrade/VersionUpgrade48to49/VersionUpgrade48to49.py @@ -29,9 +29,10 @@ class VersionUpgrade48to49(VersionUpgrade): parser["general"]["version"] = "7" # Update visibility settings to include new top_bottom category - parser["general"]["visible_settings"] += ";top_bottom" + if "visible_settings" in parser["general"]: + parser["general"]["visible_settings"] += ";top_bottom" - if "categories_expanded" in parser["cura"] and any([setting in parser["cura"]["categories_expanded"] for setting in self._moved_visibility_settings]): + if "cura" in parser and "categories_expanded" in parser["cura"] and any([setting in parser["cura"]["categories_expanded"] for setting in self._moved_visibility_settings]): parser["cura"]["categories_expanded"] += ";top_bottom" # If the account scope in 4.8 is outdated, delete it so that the user is enforced to log in again and get the From c8be7832c8b6379166ab2f92232b595e41cf82a4 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 16:06:48 +0100 Subject: [PATCH 08/35] Remove debugging code CURA-8983 --- .../qml/Preferences/Materials/MaterialsView.qml | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 97f0ce4de1..758a73b8ca 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -222,22 +222,6 @@ Item id: colorDialog title: catalog.i18nc("@title", "Material color picker") color: properties.color_code -// swatchColors: ["#2161AF", "#57AFB2", "#F7B32D", "#E33D4A", "#C088AD"] - onAccepted: { - base.setMetaDataEntry("color_code", properties.color_code, color); - console.log("color_code"); - - const timer = Qt.createQmlObject("import QtQuick 2.0; Timer {}", base); - timer.interval = 10000; - timer.repeat = true; - timer.triggered.connect(function () { - console.log("updating colors"); - colorDialog.swatchColors = ["#2161AF", "#57AFB2", "#F7B32D", "#E33D4A", "#C088AD"]; - }) - - console.log("starting timers"); - timer.start(); - } } } From 53b31e816adfa5f4489cfa84f4f9ac4a3bd045b8 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 1 Mar 2022 16:16:53 +0100 Subject: [PATCH 09/35] Set size of color swatch from theme CURA-8983 --- resources/qml/ColorDialog.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 646d23c209..24230d2011 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -75,8 +75,8 @@ UM.Dialog delegate: Rectangle { color: swatchColor - width: 24 - height: 24 + implicitWidth: UM.Theme.getSize("medium_button_icon").width + implicitHeight: UM.Theme.getSize("medium_button_icon").height radius: width / 2 UM.RecolorImage From 485335063818cdfc7c9ddf4aa27a340260f1a484 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Tue, 1 Mar 2022 17:49:14 +0100 Subject: [PATCH 10/35] make `onClicked` action a one-liner Co-authored-by: Jaime van Kessel --- resources/qml/ColorDialog.qml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 24230d2011..4ae5b3c4bc 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -90,10 +90,7 @@ UM.Dialog MouseArea { anchors.fill: parent - onClicked: - { - base.color = swatchColor; - } + onClicked: base.color = swatchColor } } } From 3cba9a9c7e59f065c75679a207a6f6fbde1cc008 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 2 Mar 2022 11:52:30 +0100 Subject: [PATCH 11/35] Update color of material after accepting the color dialog CURA-8938 --- resources/qml/Preferences/Materials/MaterialsView.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 758a73b8ca..6d153f5960 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -222,6 +222,7 @@ Item id: colorDialog title: catalog.i18nc("@title", "Material color picker") color: properties.color_code + onAccepted: base.setMetaDataEntry("color_code", properties.color_code, color) } } From 812bf2f4aabef46d100e02d76687e4175bf5f32b Mon Sep 17 00:00:00 2001 From: Ole Kroeger Date: Wed, 2 Mar 2022 14:25:05 +0100 Subject: [PATCH 12/35] use current filament diameter --- plugins/GCodeReader/FlavorParser.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/GCodeReader/FlavorParser.py b/plugins/GCodeReader/FlavorParser.py index 8d35bd3345..428d9739b0 100644 --- a/plugins/GCodeReader/FlavorParser.py +++ b/plugins/GCodeReader/FlavorParser.py @@ -53,7 +53,7 @@ class FlavorParser: def _clearValues(self) -> None: self._extruder_number = 0 - self._extrusion_length_offset = [0] # type: List[float] + self._extrusion_length_offset = [0,0,0,0] # type: List[float] self._layer_type = LayerPolygon.Inset0Type self._layer_number = 0 self._previous_z = 0 # type: float @@ -283,8 +283,9 @@ class FlavorParser: return func(position, params, path) return position - def processTCode(self, T: int, line: str, position: Position, path: List[List[Union[float, int]]]) -> Position: + def processTCode(self, global_stack, T: int, line: str, position: Position, path: List[List[Union[float, int]]]) -> Position: self._extruder_number = T + self._filament_diameter = global_stack.extruderList[self._extruder_number].getProperty("material_diameter", "value") if self._extruder_number + 1 > len(position.e): self._extrusion_length_offset.extend([0] * (self._extruder_number - len(position.e) + 1)) position.e.extend([0] * (self._extruder_number - len(position.e) + 1)) @@ -354,7 +355,7 @@ class FlavorParser: Logger.log("d", "Parsing g-code...") - current_position = Position(0, 0, 0, 0, [0]) + current_position = Position(0, 0, 0, 0, [0,0,0,0]) current_path = [] #type: List[List[float]] min_layer_number = 0 negative_layers = 0 @@ -444,7 +445,7 @@ class FlavorParser: # When changing tool, store the end point of the previous path, then process the code and finally # add another point with the new position of the head. current_path.append([current_position.x, current_position.y, current_position.z, current_position.f, current_position.e[self._extruder_number], LayerPolygon.MoveCombingType]) - current_position = self.processTCode(T, line, current_position, current_path) + current_position = self.processTCode(global_stack, T, line, current_position, current_path) current_path.append([current_position.x, current_position.y, current_position.z, current_position.f, current_position.e[self._extruder_number], LayerPolygon.MoveCombingType]) if line.startswith("M"): From 37ae1cd69df0c556134d8a9176f1531b10018791 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Wed, 2 Mar 2022 18:05:50 +0100 Subject: [PATCH 13/35] Workaround on Windows. part of CURA-8938 --- resources/qml/ColorDialog.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/qml/ColorDialog.qml b/resources/qml/ColorDialog.qml index 4ae5b3c4bc..3818ea5cb4 100644 --- a/resources/qml/ColorDialog.qml +++ b/resources/qml/ColorDialog.qml @@ -24,11 +24,13 @@ UM.Dialog // In this case we would like to let the content of the dialog determine the size of the dialog // however with the current implementation of the dialog this is not possible, so instead we calculate // the size of the dialog ourselves. - minimumWidth: content.width + 2 * margin + minimumWidth: content.width + 4 * margin minimumHeight: content.height // content height + buttonRow.height // button row height - + 3 * margin // top and bottom margin and margin between buttons and content + + 5 * margin // top and bottom margin and margin between buttons and content + width: minimumWidth + height: minimumHeight property alias color: colorInput.text property var swatchColors: [ From 0ff94c6150ac6bcfb1c03677fd438e51f27887dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=B6ger?= Date: Thu, 3 Mar 2022 11:03:28 +0100 Subject: [PATCH 14/35] Update plugins/GCodeReader/FlavorParser.py Co-authored-by: Jaime van Kessel --- plugins/GCodeReader/FlavorParser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/GCodeReader/FlavorParser.py b/plugins/GCodeReader/FlavorParser.py index 428d9739b0..147718449a 100644 --- a/plugins/GCodeReader/FlavorParser.py +++ b/plugins/GCodeReader/FlavorParser.py @@ -53,7 +53,7 @@ class FlavorParser: def _clearValues(self) -> None: self._extruder_number = 0 - self._extrusion_length_offset = [0,0,0,0] # type: List[float] + self._extrusion_length_offset = [0] * 8 # type: List[float] self._layer_type = LayerPolygon.Inset0Type self._layer_number = 0 self._previous_z = 0 # type: float From 893da1ed389d66350419aba32cd02e968211409f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ole=20Kr=C3=B6ger?= Date: Thu, 3 Mar 2022 11:03:33 +0100 Subject: [PATCH 15/35] Update plugins/GCodeReader/FlavorParser.py Co-authored-by: Jaime van Kessel --- plugins/GCodeReader/FlavorParser.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/GCodeReader/FlavorParser.py b/plugins/GCodeReader/FlavorParser.py index 147718449a..ac24ce3184 100644 --- a/plugins/GCodeReader/FlavorParser.py +++ b/plugins/GCodeReader/FlavorParser.py @@ -355,7 +355,7 @@ class FlavorParser: Logger.log("d", "Parsing g-code...") - current_position = Position(0, 0, 0, 0, [0,0,0,0]) + current_position = Position(0, 0, 0, 0, [0] * 8) current_path = [] #type: List[List[float]] min_layer_number = 0 negative_layers = 0 From a0f9febf628ea579866a0b3906102872617ccaf8 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 3 Mar 2022 12:53:46 +0100 Subject: [PATCH 16/35] Fix highlight color of quality dropdown CURA-8928 --- resources/qml/PrintSetupSelector/Custom/MenuButton.qml | 5 +---- resources/qml/ToolTip.qml | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/resources/qml/PrintSetupSelector/Custom/MenuButton.qml b/resources/qml/PrintSetupSelector/Custom/MenuButton.qml index 40c3d73e8b..5f5b5d2629 100644 --- a/resources/qml/PrintSetupSelector/Custom/MenuButton.qml +++ b/resources/qml/PrintSetupSelector/Custom/MenuButton.qml @@ -23,10 +23,7 @@ Button background: Rectangle { id: backgroundRectangle - border.width: UM.Theme.getSize("default_lining").width - border.color: button.checked ? UM.Theme.getColor("setting_control_border_highlight") : "transparent" - color: button.hovered ? UM.Theme.getColor("action_button_hovered") : "transparent" - radius: UM.Theme.getSize("action_button_radius").width + color: button.hovered ? UM.Theme.getColor("background_2"): UM.Theme.getColor("background_1") } // Workaround to ensure that the mnemonic highlighting happens correctly diff --git a/resources/qml/ToolTip.qml b/resources/qml/ToolTip.qml index f02bf0b50f..9937c92826 100644 --- a/resources/qml/ToolTip.qml +++ b/resources/qml/ToolTip.qml @@ -29,6 +29,7 @@ ToolTip visible: opacity != 0.0 opacity: 0.0 // initially hidden + Behavior on opacity { NumberAnimation { duration: 100; } From eb8fd44e4cca6a5a64a4e4454e18d4ab847e5f9f Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 3 Mar 2022 13:01:42 +0100 Subject: [PATCH 17/35] Fix launching the usb printing menu Some imports were incorrect/missing. CURA-9000 --- resources/qml/PrinterOutput/ExtruderBox.qml | 2 +- resources/qml/PrinterOutput/HeatedBedBox.qml | 2 +- resources/qml/PrinterOutput/ManualPrinterControl.qml | 1 + resources/qml/PrinterOutput/OutputDeviceHeader.qml | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/qml/PrinterOutput/ExtruderBox.qml b/resources/qml/PrinterOutput/ExtruderBox.qml index d1d28b3cfe..bea7c3bdd8 100644 --- a/resources/qml/PrinterOutput/ExtruderBox.qml +++ b/resources/qml/PrinterOutput/ExtruderBox.qml @@ -4,7 +4,7 @@ import QtQuick 2.2 import QtQuick.Controls 2.1 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura diff --git a/resources/qml/PrinterOutput/HeatedBedBox.qml b/resources/qml/PrinterOutput/HeatedBedBox.qml index 9343ca8826..288e9cab3f 100644 --- a/resources/qml/PrinterOutput/HeatedBedBox.qml +++ b/resources/qml/PrinterOutput/HeatedBedBox.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.4 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura Item diff --git a/resources/qml/PrinterOutput/ManualPrinterControl.qml b/resources/qml/PrinterOutput/ManualPrinterControl.qml index f53a45905c..bf987b282f 100644 --- a/resources/qml/PrinterOutput/ManualPrinterControl.qml +++ b/resources/qml/PrinterOutput/ManualPrinterControl.qml @@ -3,6 +3,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.1 +import QtQuick.Layouts 1.3 import UM 1.5 as UM import Cura 1.0 as Cura diff --git a/resources/qml/PrinterOutput/OutputDeviceHeader.qml b/resources/qml/PrinterOutput/OutputDeviceHeader.qml index 56c8fcb936..aeb9d14363 100644 --- a/resources/qml/PrinterOutput/OutputDeviceHeader.qml +++ b/resources/qml/PrinterOutput/OutputDeviceHeader.qml @@ -5,7 +5,7 @@ import QtQuick 2.2 import QtQuick.Controls 2.1 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura From fc577ffcbcea7a4be4493ccdbadc7db0dc4d7ad8 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 3 Mar 2022 13:09:09 +0100 Subject: [PATCH 18/35] Improve margins of qualities menu CURA-8928 --- resources/qml/PrintSetupSelector/Custom/MenuButton.qml | 4 ++-- .../PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/resources/qml/PrintSetupSelector/Custom/MenuButton.qml b/resources/qml/PrintSetupSelector/Custom/MenuButton.qml index 5f5b5d2629..cfb08b82c0 100644 --- a/resources/qml/PrintSetupSelector/Custom/MenuButton.qml +++ b/resources/qml/PrintSetupSelector/Custom/MenuButton.qml @@ -18,11 +18,11 @@ Button property string labelText: "" id: button hoverEnabled: true - leftPadding:UM.Theme.getSize("wide_margin").width + leftPadding: UM.Theme.getSize("default_margin").width background: Rectangle { - id: backgroundRectangle + id: backgroundRectanglewide_margin color: button.hovered ? UM.Theme.getColor("background_2"): UM.Theme.getColor("background_1") } diff --git a/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml b/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml index d6901cfc7f..d7562ef2db 100644 --- a/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml +++ b/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml @@ -130,6 +130,7 @@ Popup checkable: true visible: model.available text: model.name + " - " + model.layer_height + " mm" + leftPadding: UM.Theme.getSize("wide_margin").width checked: { if (Cura.MachineManager.hasCustomQuality) @@ -195,6 +196,7 @@ Popup checkable: true visible: model.available text: model.name + leftPadding: UM.Theme.getSize("wide_margin").width checked: { var active_quality_group = Cura.MachineManager.activeQualityChangesGroup @@ -295,13 +297,12 @@ Popup id: textLabel text: manageProfilesButton.text height: contentHeight - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_margin").width + UM.Theme.getSize("narrow_margin").width } UM.Label { id: shortcutLabel text: Cura.Actions.manageProfiles.shortcut + color: UM.Theme.getColor("text_lighter") height: contentHeight anchors.right: parent.right anchors.rightMargin: UM.Theme.getSize("default_margin").width From cbbe961a44799c69fefea45de40fd0a2d1f37109 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 3 Mar 2022 13:46:38 +0100 Subject: [PATCH 19/35] Let quality intents menu use checkmark to indicate active profile CURA-8928 --- resources/qml/Actions.qml | 2 +- .../PrintSetupSelector/Custom/MenuButton.qml | 32 ++++++++++++++++--- .../Custom/QualitiesWithIntentMenu.qml | 4 +-- 3 files changed, 30 insertions(+), 8 deletions(-) diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index 4e2a05a6aa..ec25eb8abb 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -222,7 +222,7 @@ Item id: updateProfileAction enabled: !Cura.MachineManager.stacksHaveErrors && Cura.MachineManager.hasUserSettings && Cura.MachineManager.activeQualityChangesGroup != null text: catalog.i18nc("@action:inmenu menubar:profile", "&Update profile with current settings/overrides"); - onTriggered: Cura.ContainerManager.updateQualityChanges(); + onTriggered: Cura.ContainerManager.updateQualityChanges() } Action diff --git a/resources/qml/PrintSetupSelector/Custom/MenuButton.qml b/resources/qml/PrintSetupSelector/Custom/MenuButton.qml index cfb08b82c0..b7b9b14d5d 100644 --- a/resources/qml/PrintSetupSelector/Custom/MenuButton.qml +++ b/resources/qml/PrintSetupSelector/Custom/MenuButton.qml @@ -19,10 +19,14 @@ Button id: button hoverEnabled: true leftPadding: UM.Theme.getSize("default_margin").width + implicitWidth: UM.Theme.getSize("menu").width + implicitHeight: UM.Theme.getSize("menu").height + UM.Theme.getSize("narrow_margin").height background: Rectangle { id: backgroundRectanglewide_margin + height: button.height + width: button.width color: button.hovered ? UM.Theme.getColor("background_2"): UM.Theme.getColor("background_1") } @@ -37,11 +41,29 @@ Button return txt } - contentItem: UM.Label + contentItem: Item { - id: textLabel - text: button.text != "" ? replaceText(button.text) : replaceText(button.labelText) - height: contentHeight - color: button.enabled ? UM.Theme.getColor("text") :UM.Theme.getColor("text_inactive") + height: button.height + width: button.width + UM.RecolorImage + { + id: check + height: UM.Theme.getSize("default_arrow").height + width: height + source: UM.Theme.getIcon("Check", "low") + color: UM.Theme.getColor("setting_control_text") + anchors.verticalCenter: parent.verticalCenter + visible: button.checked + } + UM.Label + { + id: textLabel + text: button.text != "" ? replaceText(button.text) : replaceText(button.labelText) + height: contentHeight + color: button.enabled ? UM.Theme.getColor("text") :UM.Theme.getColor("text_inactive") + anchors.left: check.right + anchors.leftMargin: UM.Theme.getSize("narrow_margin").width + anchors.verticalCenter: parent.verticalCenter + } } } \ No newline at end of file diff --git a/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml b/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml index d7562ef2db..a2624dbf14 100644 --- a/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml +++ b/resources/qml/PrintSetupSelector/Custom/QualitiesWithIntentMenu.qml @@ -130,7 +130,7 @@ Popup checkable: true visible: model.available text: model.name + " - " + model.layer_height + " mm" - leftPadding: UM.Theme.getSize("wide_margin").width + leftPadding: UM.Theme.getSize("default_margin").width + UM.Theme.getSize("narrow_margin").width checked: { if (Cura.MachineManager.hasCustomQuality) @@ -196,7 +196,7 @@ Popup checkable: true visible: model.available text: model.name - leftPadding: UM.Theme.getSize("wide_margin").width + leftPadding: UM.Theme.getSize("default_margin").width + UM.Theme.getSize("narrow_margin").width checked: { var active_quality_group = Cura.MachineManager.activeQualityChangesGroup From 06eddc341955607520d3120361a00e6e5374bc79 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Thu, 3 Mar 2022 14:01:41 +0100 Subject: [PATCH 20/35] Set border_main for darktheme to be darker CURA-8975 --- resources/themes/cura-dark/theme.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 8f45471344..7b2c19ff01 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -13,7 +13,7 @@ "accent_1": [25, 110, 240, 255], "accent_2": [16, 70, 156, 255], - "border_main": [212, 212, 212, 255], + "border_main": [118, 118, 119, 255], "border_accent_1": [255, 255, 255, 255], "border_accent_2": [16, 70, 156, 255], "border_field": [57, 57, 58, 255], From 066a4936e348b31c23dcfcc64cfe274982205f24 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 4 Mar 2022 07:38:27 +0100 Subject: [PATCH 21/35] Manually revert fuzzy skin disable. Re-implementing this feature for Arachne, so it should be (possible to) enable(d) again. part of CURA-7887 --- resources/definitions/fdmprinter.def.json | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 7bb24d7445..b1cbb07904 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -6963,7 +6963,6 @@ "type": "bool", "default_value": false, "limit_to_extruder": "wall_0_extruder_nr", - "enabled": false, "settable_per_mesh": true }, "magic_fuzzy_skin_outside_only": @@ -6972,7 +6971,7 @@ "description": "Jitter only the parts' outlines and not the parts' holes.", "type": "bool", "default_value": false, - "enabled": "magic_fuzzy_skin_enabled and False" , + "enabled": "magic_fuzzy_skin_enabled", "limit_to_extruder": "wall_0_extruder_nr", "settable_per_mesh": true }, @@ -6985,7 +6984,7 @@ "default_value": 0.3, "minimum_value": "0.001", "maximum_value_warning": "wall_line_width_0", - "enabled": "magic_fuzzy_skin_enabled and False", + "enabled": "magic_fuzzy_skin_enabled", "limit_to_extruder": "wall_0_extruder_nr", "settable_per_mesh": true }, @@ -7000,7 +6999,7 @@ "minimum_value_warning": "0.1", "maximum_value_warning": "10", "maximum_value": "2 / magic_fuzzy_skin_thickness", - "enabled": "magic_fuzzy_skin_enabled and False", + "enabled": "magic_fuzzy_skin_enabled", "limit_to_extruder": "wall_0_extruder_nr", "settable_per_mesh": true, "children": @@ -7016,7 +7015,7 @@ "minimum_value_warning": "0.1", "maximum_value_warning": "10", "value": "10000 if magic_fuzzy_skin_point_density == 0 else 1 / magic_fuzzy_skin_point_density", - "enabled": "magic_fuzzy_skin_enabled and False", + "enabled": "magic_fuzzy_skin_enabled", "limit_to_extruder": "wall_0_extruder_nr", "settable_per_mesh": true } From d1a42e4e77f5b1be530e3fd88fb8c09e89a830cc Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 4 Mar 2022 09:18:48 +0100 Subject: [PATCH 22/35] Update gcode text area in machine settings to have new border highlighting style and background color. Swapped out default Label for UM.Label so it is easier to change styling in the future. CURA-8943 --- .../qml/MachineSettings/GcodeTextArea.qml | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/resources/qml/MachineSettings/GcodeTextArea.qml b/resources/qml/MachineSettings/GcodeTextArea.qml index 5292b4f83a..bb14dafcc6 100644 --- a/resources/qml/MachineSettings/GcodeTextArea.qml +++ b/resources/qml/MachineSettings/GcodeTextArea.qml @@ -35,23 +35,24 @@ UM.TooltipArea watchedProperties: [ "value", "description" ] } - Label // Title Label + UM.Label { id: titleLabel anchors.top: parent.top anchors.left: parent.left font: UM.Theme.getFont("medium_bold") - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering } Flickable { - anchors.top: titleLabel.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height - anchors.bottom: parent.bottom - anchors.left: parent.left - anchors.right: parent.right + anchors + { + top: titleLabel.bottom + topMargin: UM.Theme.getSize("default_margin").height + bottom: parent.bottom + left: parent.left + right: parent.right + } ScrollBar.vertical: UM.ScrollBar {} @@ -78,10 +79,10 @@ UM.TooltipArea background: Rectangle { - color: UM.Theme.getColor("main_background") anchors.fill: parent anchors.margins: -border.width //Wrap the border around the parent. + color: UM.Theme.getColor("detail_background") border.color: { if (!gcodeTextArea.enabled) @@ -90,9 +91,9 @@ UM.TooltipArea } if (gcodeTextArea.hovered || gcodeTextArea.activeFocus) { - return UM.Theme.getColor("setting_control_border_highlight") + return UM.Theme.getColor("border_main_light") } - return UM.Theme.getColor("setting_control_border") + return UM.Theme.getColor("border_field_light") } border.width: UM.Theme.getSize("default_lining").width } From 2ed68beb22db423bc8774643c767baae2031db3b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Fri, 4 Mar 2022 10:30:26 +0100 Subject: [PATCH 23/35] Fix display of profile name in header Without no-wrap, longer names would be put on multiple lines. These would then spill out of the display element --- resources/qml/IconWithText.qml | 1 + resources/qml/PrintSetupSelector/PrintSetupSelectorHeader.qml | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/IconWithText.qml b/resources/qml/IconWithText.qml index 8a76481da9..d7b4adfa8c 100644 --- a/resources/qml/IconWithText.qml +++ b/resources/qml/IconWithText.qml @@ -21,6 +21,7 @@ Item property alias font: label.font property alias elide: label.elide property real margin: UM.Theme.getSize("narrow_margin").width + property alias wrapMode: label.wrapMode // These properties can be used in combination with layouts. readonly property real contentWidth: icon.width + margin + label.contentWidth diff --git a/resources/qml/PrintSetupSelector/PrintSetupSelectorHeader.qml b/resources/qml/PrintSetupSelector/PrintSetupSelectorHeader.qml index 3b6fc37eb4..41e913a2c1 100644 --- a/resources/qml/PrintSetupSelector/PrintSetupSelectorHeader.qml +++ b/resources/qml/PrintSetupSelector/PrintSetupSelectorHeader.qml @@ -39,7 +39,7 @@ RowLayout } font: UM.Theme.getFont("medium") elide: Text.ElideMiddle - + wrapMode: Text.NoWrap UM.SettingPropertyProvider { id: layerHeight From a26b54f6e2b24e643175f709c8ffd2e641d27f45 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 4 Mar 2022 11:28:11 +0100 Subject: [PATCH 24/35] Fix checkboxes not showing check marks when disabled. Update checkboxes to align with new designs. Update SettingCheckBox to match checkbox styling. Remove duplicated styling inside cura-dark/theme.json CURA-8991 --- resources/qml/Settings/SettingCheckBox.qml | 10 +++++----- resources/themes/cura-dark/theme.json | 9 --------- resources/themes/cura-light/theme.json | 15 +++++++++------ 3 files changed, 14 insertions(+), 20 deletions(-) diff --git a/resources/qml/Settings/SettingCheckBox.qml b/resources/qml/Settings/SettingCheckBox.qml index 1b4e4ac143..3f8f1de89d 100644 --- a/resources/qml/Settings/SettingCheckBox.qml +++ b/resources/qml/Settings/SettingCheckBox.qml @@ -11,7 +11,7 @@ SettingItem { id: base property var focusItem: control - + enabled: false contents: MouseArea { id: control @@ -98,7 +98,7 @@ SettingItem { if(!enabled) { - return UM.Theme.getColor("checkbox_border") + return UM.Theme.getColor("checkbox_border_disabled") } switch (propertyProvider.properties.validationState) { @@ -116,7 +116,7 @@ SettingItem { return UM.Theme.getColor("checkbox_border_hover") } - return UM.Theme.getColor("setting_control_border") + return UM.Theme.getColor("checkbox_border") } color: { @@ -138,7 +138,7 @@ SettingItem // Validation is OK. if (control.containsMouse || control.activeFocus) { - return UM.Theme.getColor("setting_control_highlight") + return UM.Theme.getColor("checkbox_hover") } return UM.Theme.getColor("checkbox") } @@ -150,7 +150,7 @@ SettingItem height: UM.Theme.getSize("checkbox_mark").height width: UM.Theme.getSize("checkbox_mark").width sourceSize.height: width - color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text"); + color: !enabled ? UM.Theme.getColor("checkbox_mark_disabled") : UM.Theme.getColor("checkbox_mark"); source: UM.Theme.getIcon("Check", "low") opacity: control.checked ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 100; } } diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 7b2c19ff01..bc1f6e3b9f 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -155,15 +155,6 @@ "slider_handle": [255, 255, 255, 255], "slider_handle_active": [68, 192, 255, 255], - "checkbox": "background_1", - "checkbox_hover": [43, 48, 52, 255], - "checkbox_border": "text_disabled", - "checkbox_border_hover": "border_main", - "checkbox_mark": "text_default", - "checkbox_square": "text_disabled", - "checkbox_text": "text_default", - "checkbox_disabled": "background_2", - "category_background": "background_3", "tooltip": "background_2", diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index ba18e5d0d2..b71d6c0167 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -324,13 +324,16 @@ "quality_slider_unavailable": [179, 179, 179, 255], "quality_slider_available": [0, 0, 0, 255], - "checkbox": [255, 255, 255, 255], - "checkbox_hover": "border_main", - "checkbox_border": [180, 180, 180, 255], - "checkbox_border_hover": [25, 110, 240, 255], - "checkbox_mark": [35, 35, 35, 255], + "checkbox": "background_1", + "checkbox_hover": "background_1", "checkbox_disabled": "background_2", - "checkbox_text": [0, 12, 26, 255], + "checkbox_border": [180, 180, 180, 255], + "checkbox_border_hover": "border_main", + "checkbox_border_disabled": "text_disabled", + "checkbox_mark": "text_default", + "checkbox_mark_disabled": "text_disabled", + "checkbox_text": "text_default", + "checkbox_text_disabled": "text_disabled", "category_background": "background_2", From b86b1133df928c0d65da888001b8965106268c66 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 4 Mar 2022 13:02:21 +0100 Subject: [PATCH 25/35] Remove enable:false assignment that was used for testing CURA-8991 --- resources/qml/Settings/SettingCheckBox.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Settings/SettingCheckBox.qml b/resources/qml/Settings/SettingCheckBox.qml index 3f8f1de89d..4987eedb83 100644 --- a/resources/qml/Settings/SettingCheckBox.qml +++ b/resources/qml/Settings/SettingCheckBox.qml @@ -11,7 +11,7 @@ SettingItem { id: base property var focusItem: control - enabled: false + contents: MouseArea { id: control From b3e8c7190e04d028c9828e2e43bce90af2c829dd Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 4 Mar 2022 13:18:00 +0100 Subject: [PATCH 26/35] Align radio buttons with new designs. Fix radiobutton looking the same checked and unchecked when disabled CURA-8991 --- resources/qml/Widgets/RadioButton.qml | 79 ++++++++++++++++++-------- resources/themes/cura-light/theme.json | 13 +++++ 2 files changed, 68 insertions(+), 24 deletions(-) diff --git a/resources/qml/Widgets/RadioButton.qml b/resources/qml/Widgets/RadioButton.qml index 428eb8a4e5..add708507c 100644 --- a/resources/qml/Widgets/RadioButton.qml +++ b/resources/qml/Widgets/RadioButton.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2019 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -13,32 +13,58 @@ import Cura 1.0 as Cura // RadioButton { - id: radioButton + id: control font: UM.Theme.getFont("default") states: [ State { - name: "checked" - when: radioButton.checked + name: "selected-hover" + when: control.enabled && control.checked && control.hovered PropertyChanges { - target: indicator - color: UM.Theme.getColor("accent_1") - border.width: 0 + target: indicator_background + color: UM.Theme.getColor("radio_selected") + border.color: UM.Theme.getColor("radio_border_hover") } }, - State - { - name: "disabled" - when: !radioButton.enabled - PropertyChanges { target: indicator; color: UM.Theme.getColor("background_1")} + State { + name: "selected" + when: control.enabled && control.checked + PropertyChanges + { + target: indicator_background + color: UM.Theme.getColor("radio_selected") + } }, - State - { - name: "highlighted" - when: radioButton.hovered || radioButton.activeFocus - PropertyChanges { target: indicator; border.color: UM.Theme.getColor("border_main_light")} + State { + name: "hovered" + when: control.enabled && control.hovered + PropertyChanges + { + target: indicator_background + border.color: UM.Theme.getColor("radio_border_hover") + } + }, + State { + name: "selected_disabled" + when: !control.enabled && control.checked + PropertyChanges + { + target: indicator_background + color: UM.Theme.getColor("radio_selected_disabled") + border.color: UM.Theme.getColor("radio_border_disabled") + } + }, + State { + name: "disabled" + when: !control.enabled + PropertyChanges + { + target: indicator_background + color: UM.Theme.getColor("radio_disabled") + border.color: UM.Theme.getColor("radio_border_disabled") + } } ] @@ -49,30 +75,35 @@ RadioButton indicator: Rectangle { + id: indicator_background implicitWidth: UM.Theme.getSize("radio_button").width implicitHeight: UM.Theme.getSize("radio_button").height anchors.verticalCenter: parent.verticalCenter anchors.alignWhenCentered: false radius: width / 2 - color: UM.Theme.getColor("background_2") + color: UM.Theme.getColor("radio") border.width: UM.Theme.getSize("default_lining").width - border.color: UM.Theme.getColor("text_disabled") + border.color: UM.Theme.getColor("radio_border") Rectangle { + id: indicator_dot width: (parent.width / 2) | 0 height: width anchors.centerIn: parent radius: width / 2 - color: radioButton.enabled ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1") - visible: radioButton.checked + color: control.enabled ? UM.Theme.getColor("radio_dot") : UM.Theme.getColor("radio_dot_disabled") + visible: control.checked + + } } contentItem: UM.Label { - leftPadding: radioButton.indicator.width + radioButton.spacing - text: radioButton.text - font: radioButton.font + leftPadding: control.indicator.width + control.spacing + text: control.text + font: control.font + color: control.enabled ? UM.Theme.getColor("radio_text"): UM.Theme.getColor("radio_text_disabled") } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index b71d6c0167..f96a45e32f 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -335,6 +335,19 @@ "checkbox_text": "text_default", "checkbox_text_disabled": "text_disabled", + "radio": "background_1", + "radio_disabled": "background_2", + "radio_selected": "accent_1", + "radio_selected_disabled": "text_disabled", + "radio_border": [180, 180, 180, 255], + "radio_border_hover": "border_main", + "radio_border_disabled": "text_disabled", + "radio_dot": "background_1", + "radio_dot_disabled": "background_2", + "radio_text": "text_default", + "radio_text_disabled": "text_disabled", + + "category_background": "background_2", "tooltip": [25, 25, 25, 255], From 1fc6b8ced62cdc41bbec5b0ecfc1c46eb2a04b46 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 4 Mar 2022 13:22:55 +0100 Subject: [PATCH 27/35] New designs use dark mode border_main for dark theme. Remove uses of border_main_light. The only puprose of this color was to give dark mode access to the border_main of the light theme. CURA-8991 --- resources/qml/MachineSettings/GcodeTextArea.qml | 2 +- resources/qml/MachineSettings/NumericTextFieldWithUnit.qml | 2 +- resources/qml/PrintSetupHeaderButton.qml | 2 +- resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml | 2 +- resources/qml/Settings/SettingExtruder.qml | 2 +- resources/qml/Settings/SettingOptionalExtruder.qml | 2 +- resources/qml/Settings/SettingTextField.qml | 2 +- resources/qml/Widgets/ComboBox.qml | 2 +- resources/qml/Widgets/TextField.qml | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/resources/qml/MachineSettings/GcodeTextArea.qml b/resources/qml/MachineSettings/GcodeTextArea.qml index bb14dafcc6..7791e169c2 100644 --- a/resources/qml/MachineSettings/GcodeTextArea.qml +++ b/resources/qml/MachineSettings/GcodeTextArea.qml @@ -91,7 +91,7 @@ UM.TooltipArea } if (gcodeTextArea.hovered || gcodeTextArea.activeFocus) { - return UM.Theme.getColor("border_main_light") + return UM.Theme.getColor("border_main") } return UM.Theme.getColor("border_field_light") } diff --git a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml index 0e1f296cfa..18c3f8bbe5 100644 --- a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml +++ b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml @@ -107,7 +107,7 @@ UM.TooltipArea // Validation is OK. if (textFieldWithUnit.hovered || textFieldWithUnit.activeFocus) { - return UM.Theme.getColor("border_main_light") + return UM.Theme.getColor("border_main") } return UM.Theme.getColor("border_field_light") } diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index e41f95f778..f552b9fc37 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -69,7 +69,7 @@ ToolButton { target: background color: UM.Theme.getColor("setting_control") - liningColor: UM.Theme.getColor("border_main_light") + liningColor: UM.Theme.getColor("border_main") } }, State diff --git a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml index 440c9e4e78..6d3682d9ff 100644 --- a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml @@ -129,7 +129,7 @@ Item background: UM.UnderlineBackground { id: backgroundItem - liningColor: intentSelection.hovered ? UM.Theme.getColor("border_main_light") : UM.Theme.getColor("border_field_light") + liningColor: intentSelection.hovered ? UM.Theme.getColor("border_main") : UM.Theme.getColor("border_field_light") } UM.SimpleButton diff --git a/resources/qml/Settings/SettingExtruder.qml b/resources/qml/Settings/SettingExtruder.qml index 6b2ac55066..c3bc472fbe 100644 --- a/resources/qml/Settings/SettingExtruder.qml +++ b/resources/qml/Settings/SettingExtruder.qml @@ -135,7 +135,7 @@ SettingItem } if (control.hovered || control.activeFocus) { - return UM.Theme.getColor("border_main_light") + return UM.Theme.getColor("border_main") } return UM.Theme.getColor("border_field_light") } diff --git a/resources/qml/Settings/SettingOptionalExtruder.qml b/resources/qml/Settings/SettingOptionalExtruder.qml index 1ac7afe967..2a4db2ab31 100644 --- a/resources/qml/Settings/SettingOptionalExtruder.qml +++ b/resources/qml/Settings/SettingOptionalExtruder.qml @@ -136,7 +136,7 @@ SettingItem } if (control.hovered || control.activeFocus) { - return UM.Theme.getColor("border_main_light") + return UM.Theme.getColor("border_main") } return UM.Theme.getColor("border_field_light") } diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index 83b5d2a987..7aacad21da 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -52,7 +52,7 @@ SettingItem //Validation is OK. if(hovered || input.activeFocus) { - return UM.Theme.getColor("border_main_light") + return UM.Theme.getColor("border_main") } return UM.Theme.getColor("border_field_light") } diff --git a/resources/qml/Widgets/ComboBox.qml b/resources/qml/Widgets/ComboBox.qml index f84772e609..5d31348597 100644 --- a/resources/qml/Widgets/ComboBox.qml +++ b/resources/qml/Widgets/ComboBox.qml @@ -33,7 +33,7 @@ ComboBox { name: "highlighted" when: control.hovered || control.activeFocus - PropertyChanges { target: background; liningColor: UM.Theme.getColor("border_main_light")} + PropertyChanges { target: background; liningColor: UM.Theme.getColor("border_main")} } ] diff --git a/resources/qml/Widgets/TextField.qml b/resources/qml/Widgets/TextField.qml index 7803c17396..2dc0882b4b 100644 --- a/resources/qml/Widgets/TextField.qml +++ b/resources/qml/Widgets/TextField.qml @@ -44,7 +44,7 @@ TextField { name: "hovered" when: textField.hovered || textField.activeFocus - PropertyChanges { target: backgroundRectangle; liningColor: UM.Theme.getColor("border_main_light")} + PropertyChanges { target: backgroundRectangle; liningColor: UM.Theme.getColor("border_main")} } ] From fb42679d0800907c749f1ac36b37d0a128644509 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 4 Mar 2022 13:39:50 +0100 Subject: [PATCH 28/35] Update TextField to match designs when disabled. CURA-8991 --- resources/qml/Widgets/TextField.qml | 19 ++++++++++--------- resources/themes/cura-light/theme.json | 8 ++++++++ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/resources/qml/Widgets/TextField.qml b/resources/qml/Widgets/TextField.qml index 2dc0882b4b..b708446d65 100644 --- a/resources/qml/Widgets/TextField.qml +++ b/resources/qml/Widgets/TextField.qml @@ -1,4 +1,4 @@ -// Copyright (c) 2021 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 @@ -13,7 +13,7 @@ import Cura 1.1 as Cura // TextField { - id: textField + id: control property alias leftIcon: iconLeft.source @@ -22,7 +22,7 @@ TextField hoverEnabled: true selectByMouse: true font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") + color: UM.Theme.getColor("text_field_text") renderType: Text.NativeRendering selectionColor: UM.Theme.getColor("text_selection") leftPadding: iconLeft.visible ? iconLeft.width + UM.Theme.getSize("default_margin").width * 2 : UM.Theme.getSize("thin_margin").width @@ -31,20 +31,21 @@ TextField State { name: "disabled" - when: !textField.enabled - PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_disabled")} + when: !control.enabled + PropertyChanges { target: control; color: UM.Theme.getColor("text_field_text_disabled")} + PropertyChanges { target: backgroundRectangle; liningColor: UM.Theme.getColor("text_field_border_disabled")} }, State { name: "invalid" - when: !textField.acceptableInput + when: !control.acceptableInput PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_validation_error_background")} }, State { name: "hovered" - when: textField.hovered || textField.activeFocus - PropertyChanges { target: backgroundRectangle; liningColor: UM.Theme.getColor("border_main")} + when: control.hovered || control.activeFocus + PropertyChanges { target: backgroundRectangle; liningColor: UM.Theme.getColor("text_field_border_hovered")} } ] @@ -66,7 +67,7 @@ TextField visible: source != "" height: UM.Theme.getSize("small_button_icon").height width: visible ? height : 0 - color: textField.color + color: control.color } } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index f96a45e32f..9ef04873c1 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -347,6 +347,14 @@ "radio_text": "text_default", "radio_text_disabled": "text_disabled", + "text_field": "background_1", + "text_field_border": [180, 180, 180, 255], + "text_field_border_hovered": "border_main", + "text_field_border_disabled": "border_main", + "text_field_text": "text_default", + "text_field_text_disabled": "text_disabled", + + "category_background": "background_2", From 7dabcfafb0d640bb0d2c6cd2d226e842304f496d Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 4 Mar 2022 13:48:01 +0100 Subject: [PATCH 29/35] Add checkbox square coloring back. CURA-8991 --- resources/themes/cura-light/theme.json | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 9ef04873c1..9569ccfc53 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -332,6 +332,7 @@ "checkbox_border_disabled": "text_disabled", "checkbox_mark": "text_default", "checkbox_mark_disabled": "text_disabled", + "checkbox_square": [180, 180, 180, 255], "checkbox_text": "text_default", "checkbox_text_disabled": "text_disabled", From 1eb16c0ec558ed012c7db1a98cdaf78e7abecbeb Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 4 Mar 2022 13:53:59 +0100 Subject: [PATCH 30/35] Update SettingTextField to match TextField CURA-8991 --- resources/qml/Settings/SettingTextField.qml | 10 +++++----- resources/themes/cura-light/theme.json | 2 -- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index 7aacad21da..68d206b96c 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -36,7 +36,7 @@ SettingItem { if(!enabled) { - return UM.Theme.getColor("setting_control_disabled_border") + return UM.Theme.getColor("text_field_border_disabled") } switch(propertyProvider.properties.validationState) { @@ -52,15 +52,15 @@ SettingItem //Validation is OK. if(hovered || input.activeFocus) { - return UM.Theme.getColor("border_main") + return UM.Theme.getColor("text_field_border_hovered") } - return UM.Theme.getColor("border_field_light") + return UM.Theme.getColor("text_field_border") } color: { if(!enabled) { - return UM.Theme.getColor("setting_control_disabled") + return UM.Theme.getColor("text_field") } switch(propertyProvider.properties.validationState) { @@ -76,7 +76,7 @@ SettingItem return UM.Theme.getColor("setting_validation_ok") default: - return UM.Theme.getColor("setting_control") + return UM.Theme.getColor("text_field") } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 9569ccfc53..5adb140802 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -355,8 +355,6 @@ "text_field_text": "text_default", "text_field_text_disabled": "text_disabled", - - "category_background": "background_2", "tooltip": [25, 25, 25, 255], From 45fa33584b9878ca5939adb54a72959fcdd09f5d Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 4 Mar 2022 15:05:27 +0100 Subject: [PATCH 31/35] Restore loadProjectFile function It is being used when you want to load a project file. Pretty important! Discovered while testing CURA-7950. --- resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml index 8e4cea1bdd..18891cebee 100644 --- a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml +++ b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml @@ -27,6 +27,11 @@ UM.Dialog property var fileUrls: [] property var addToRecent: true + function loadProjectFile(projectFile) + { + UM.WorkspaceFileHandler.readLocalFile(projectFile, base.addToRecent); + } + function loadModelFiles(fileUrls) { for (var i in fileUrls) From 719257bb63b1dafcaa69bbd3158584cc313d3e74 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 4 Mar 2022 15:05:30 +0100 Subject: [PATCH 32/35] Update validation colors to match new designs CURA-8991 --- resources/qml/Settings/SettingTextField.qml | 8 ------- resources/themes/cura-dark/theme.json | 21 ++++++++++++++----- resources/themes/cura-light/theme.json | 23 ++++++++++++++++----- 3 files changed, 34 insertions(+), 18 deletions(-) diff --git a/resources/qml/Settings/SettingTextField.qml b/resources/qml/Settings/SettingTextField.qml index 68d206b96c..95976ad58e 100644 --- a/resources/qml/Settings/SettingTextField.qml +++ b/resources/qml/Settings/SettingTextField.qml @@ -80,14 +80,6 @@ SettingItem } } - Rectangle - { - anchors.fill: parent - anchors.margins: Math.round(UM.Theme.getSize("default_lining").width) - color: UM.Theme.getColor("setting_control_highlight") - opacity: !control.hovered ? 0 : propertyProvider.properties.validationState == "ValidatorState.Valid" ? 1.0 : 0.35 - } - UM.Label { anchors diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index bc1f6e3b9f..afd36e8741 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -23,7 +23,20 @@ "text_primary_button": [255, 255, 255, 255], "text_secondary_button": [255, 255, 255, 255], "text_link_hover": [156, 195, 255, 255], - "text_lighter": [243, 243, 243, 255] + "text_lighter": [243, 243, 243, 255], + + "um_green_1": [233, 245, 237, 255], + "um_green_5": [36, 162, 73, 255], + "um_green_9": [31, 44, 36, 255], + "um_red_1": [251, 232, 233, 255], + "um_red_5": [218, 30, 40, 255], + "um_red_9": [59, 31, 33, 255], + "um_orange_1": [255, 235, 221, 255], + "um_orange_5": [252, 123, 30, 255], + "um_orange_9": [64, 45, 32, 255], + "um_yellow_1": [255, 248, 225, 255], + "um_yellow_5": [253, 209, 58, 255], + "um_yellow_9": [64, 58, 36, 255] }, "colors": { @@ -140,10 +153,8 @@ "setting_control_disabled_text": [255, 255, 255, 101], "setting_control_disabled_border": [255, 255, 255, 101], "setting_unit": [255, 255, 255, 127], - "setting_validation_error_background": [59, 31, 53, 255], - "setting_validation_error": [212, 31, 53, 255], - "setting_validation_warning_background": [62, 54, 46, 255], - "setting_validation_warning": [245, 166, 35, 255], + "setting_validation_error_background": "um_red_9", + "setting_validation_warning_background": "um_yellow_9", "setting_validation_ok": "background_2", "progressbar_background": [255, 255, 255, 48], diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 5adb140802..4d89c37609 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -188,7 +188,20 @@ "text_primary_button": [255, 255, 255, 255], "text_secondary_button": [25, 110, 240, 255], "text_link_hover": [16, 70, 156, 255], - "text_lighter": [108, 108, 108, 255] + "text_lighter": [108, 108, 108, 255], + + "um_green_1": [233, 245, 237, 255], + "um_green_5": [36, 162, 73, 255], + "um_green_9": [31, 44, 36, 255], + "um_red_1": [251, 232, 233, 255], + "um_red_5": [218, 30, 40, 255], + "um_red_9": [59, 31, 33, 255], + "um_orange_1": [255, 235, 221, 255], + "um_orange_5": [252, 123, 30, 255], + "um_orange_9": [64, 45, 32, 255], + "um_yellow_1": [255, 248, 225, 255], + "um_yellow_5": [253, 209, 58, 255], + "um_yellow_9": [64, 58, 36, 255] }, "colors": { @@ -304,10 +317,10 @@ "setting_control_disabled_text": [127, 127, 127, 255], "setting_control_disabled_border": [127, 127, 127, 255], "setting_unit": [127, 127, 127, 255], - "setting_validation_error_background": [255, 66, 60, 255], - "setting_validation_error": [127, 127, 127, 255], - "setting_validation_warning_background": [255, 145, 62, 255], - "setting_validation_warning": [127, 127, 127, 255], + "setting_validation_error_background": "um_red_1", + "setting_validation_error": "um_red_5", + "setting_validation_warning_background": "um_yellow_1", + "setting_validation_warning": "um_yellow_5", "setting_validation_ok": "background_2", "material_compatibility_warning": [243, 166, 59, 255], From 7b0e954f121f9278dd78957344db9fc668cb6701 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 4 Mar 2022 15:20:46 +0100 Subject: [PATCH 33/35] Change machine setting page text box text highlight color to match designs. CURA-8991 --- resources/qml/MachineSettings/NumericTextFieldWithUnit.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml index 18c3f8bbe5..67840d4f26 100644 --- a/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml +++ b/resources/qml/MachineSettings/NumericTextFieldWithUnit.qml @@ -77,6 +77,8 @@ UM.TooltipArea anchors.left: fieldLabel.right anchors.leftMargin: UM.Theme.getSize("default_margin").width verticalAlignment: Text.AlignVCenter + selectionColor: UM.Theme.getColor("text_selection") + selectedTextColor: UM.Theme.getColor("setting_control_text") padding: 0 leftPadding: UM.Theme.getSize("narrow_margin").width width: numericTextFieldWithUnit.controlWidth From 58ca09e1c6ec44d3a7ce84f6e296a019ebb536b2 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Mon, 7 Mar 2022 10:43:46 +0100 Subject: [PATCH 34/35] Remove unused id --- resources/qml/PrintSetupSelector/Custom/MenuButton.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/PrintSetupSelector/Custom/MenuButton.qml b/resources/qml/PrintSetupSelector/Custom/MenuButton.qml index b7b9b14d5d..262bc1c512 100644 --- a/resources/qml/PrintSetupSelector/Custom/MenuButton.qml +++ b/resources/qml/PrintSetupSelector/Custom/MenuButton.qml @@ -24,7 +24,6 @@ Button background: Rectangle { - id: backgroundRectanglewide_margin height: button.height width: button.width color: button.hovered ? UM.Theme.getColor("background_2"): UM.Theme.getColor("background_1") From 11d7afe5052c48a3ceaa004e59f91f33acdc9f33 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Mon, 7 Mar 2022 10:44:24 +0100 Subject: [PATCH 35/35] Formatting of inline if statement --- resources/qml/PrintSetupSelector/Custom/MenuButton.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/PrintSetupSelector/Custom/MenuButton.qml b/resources/qml/PrintSetupSelector/Custom/MenuButton.qml index 262bc1c512..112edbbf77 100644 --- a/resources/qml/PrintSetupSelector/Custom/MenuButton.qml +++ b/resources/qml/PrintSetupSelector/Custom/MenuButton.qml @@ -26,7 +26,7 @@ Button { height: button.height width: button.width - color: button.hovered ? UM.Theme.getColor("background_2"): UM.Theme.getColor("background_1") + color: button.hovered ? UM.Theme.getColor("background_2") : UM.Theme.getColor("background_1") } // Workaround to ensure that the mnemonic highlighting happens correctly