From 204d965df29f8b699c47e5f271a23c85363224b6 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 18 Jan 2022 17:43:13 +0100 Subject: [PATCH 01/50] Use `SecondaryButton` in the usb print panel inplace of tye style prop The Jog buttons are not changed yet as these button make use of the `checked` property this is not yet implemented for Cura's `Action` and by extension Cura's `Secondary` button. CURA-8684 --- resources/qml/MonitorButton.qml | 8 +- resources/qml/PrinterOutput/ExtruderBox.qml | 103 +------- resources/qml/PrinterOutput/HeatedBedBox.qml | 103 +------- .../PrinterOutput/ManualPrinterControl.qml | 26 +- resources/themes/cura-light/styles.qml | 229 ------------------ 5 files changed, 36 insertions(+), 433 deletions(-) diff --git a/resources/qml/MonitorButton.qml b/resources/qml/MonitorButton.qml index 40da10dc46..db10b2b2bc 100644 --- a/resources/qml/MonitorButton.qml +++ b/resources/qml/MonitorButton.qml @@ -266,7 +266,7 @@ Item } } - Button + Cura.SecondaryButton { id: pauseResumeButton @@ -309,11 +309,9 @@ Item activePrintJob.setState("pause"); } } - - style: UM.Theme.styles.print_setup_action_button } - Button + Cura.SecondaryButton { id: abortButton @@ -325,8 +323,6 @@ Item text: catalog.i18nc("@label", "Abort Print") onClicked: confirmationDialog.visible = true - - style: UM.Theme.styles.print_setup_action_button } MessageDialog diff --git a/resources/qml/PrinterOutput/ExtruderBox.qml b/resources/qml/PrinterOutput/ExtruderBox.qml index 63927cd98d..7ccab941b8 100644 --- a/resources/qml/PrinterOutput/ExtruderBox.qml +++ b/resources/qml/PrinterOutput/ExtruderBox.qml @@ -223,7 +223,7 @@ Item } } - Button //The pre-heat button. + Cura.SecondaryButton { id: preheatButton height: UM.Theme.getSize("setting_control").height @@ -255,96 +255,19 @@ Item anchors.right: parent.right anchors.bottom: parent.bottom anchors.margins: UM.Theme.getSize("default_margin").width - style: ButtonStyle { - background: Rectangle - { - border.width: UM.Theme.getSize("default_lining").width - implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2) - border.color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_border"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active_border"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_border"); - } - else - { - return UM.Theme.getColor("action_button_border"); - } - } - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered"); - } - else - { - return UM.Theme.getColor("action_button"); - } - } - Behavior on color - { - ColorAnimation - { - duration: 50 - } - } - Label - { - id: actualLabel - anchors.centerIn: parent - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_text"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active_text"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_text"); - } - else - { - return UM.Theme.getColor("action_button_text"); - } - } - font: UM.Theme.getFont("medium") - text: - { - if(extruderModel == null) - { - return "" - } - if(extruderModel.isPreheating ) - { - return catalog.i18nc("@button Cancel pre-heating", "Cancel") - } else - { - return catalog.i18nc("@button", "Pre-heat") - } - } - } + text: + { + if(extruderModel == null) + { + return "" + } + if(extruderModel.isPreheating ) + { + return catalog.i18nc("@button Cancel pre-heating", "Cancel") + } else + { + return catalog.i18nc("@button", "Pre-heat") } } diff --git a/resources/qml/PrinterOutput/HeatedBedBox.qml b/resources/qml/PrinterOutput/HeatedBedBox.qml index 2e3e319c89..12e24024c2 100644 --- a/resources/qml/PrinterOutput/HeatedBedBox.qml +++ b/resources/qml/PrinterOutput/HeatedBedBox.qml @@ -214,7 +214,7 @@ Item } } - Button // The pre-heat button. + Cura.SecondaryButton // The pre-heat button. { id: preheatButton height: UM.Theme.getSize("setting_control").height @@ -246,96 +246,19 @@ Item anchors.right: parent.right anchors.bottom: parent.bottom anchors.margins: UM.Theme.getSize("default_margin").width - style: ButtonStyle { - background: Rectangle - { - border.width: UM.Theme.getSize("default_lining").width - implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("default_margin").width * 2) - border.color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_border"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active_border"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_border"); - } - else - { - return UM.Theme.getColor("action_button_border"); - } - } - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered"); - } - else - { - return UM.Theme.getColor("action_button"); - } - } - Behavior on color - { - ColorAnimation - { - duration: 50 - } - } - Label - { - id: actualLabel - anchors.centerIn: parent - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_text"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active_text"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_text"); - } - else - { - return UM.Theme.getColor("action_button_text"); - } - } - font: UM.Theme.getFont("medium") - text: - { - if(printerModel == null) - { - return "" - } - if(printerModel.isPreheating ) - { - return catalog.i18nc("@button Cancel pre-heating", "Cancel") - } else - { - return catalog.i18nc("@button", "Pre-heat") - } - } - } + text: + { + if(printerModel == null) + { + return "" + } + if(printerModel.isPreheating ) + { + return catalog.i18nc("@button Cancel pre-heating", "Cancel") + } else + { + return catalog.i18nc("@button", "Pre-heat") } } diff --git a/resources/qml/PrinterOutput/ManualPrinterControl.qml b/resources/qml/PrinterOutput/ManualPrinterControl.qml index 57e1b26e72..fa7e3024dd 100644 --- a/resources/qml/PrinterOutput/ManualPrinterControl.qml +++ b/resources/qml/PrinterOutput/ManualPrinterControl.qml @@ -92,14 +92,13 @@ Item Layout.preferredHeight: height } - Button + Cura.SecondaryButton { Layout.row: 1 Layout.column: 1 Layout.preferredWidth: width Layout.preferredHeight: height iconSource: UM.Theme.getIcon("ChevronSingleUp"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -109,14 +108,13 @@ Item } } - Button + Cura.SecondaryButton { Layout.row: 2 Layout.column: 0 Layout.preferredWidth: width Layout.preferredHeight: height iconSource: UM.Theme.getIcon("ChevronSingleLeft"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -126,14 +124,13 @@ Item } } - Button + Cura.SecondaryButton { Layout.row: 2 Layout.column: 2 Layout.preferredWidth: width Layout.preferredHeight: height iconSource: UM.Theme.getIcon("ChevronSingleRight"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -143,14 +140,13 @@ Item } } - Button + Cura.SecondaryButton { Layout.row: 3 Layout.column: 1 Layout.preferredWidth: width Layout.preferredHeight: height iconSource: UM.Theme.getIcon("ChevronSingleDown"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -160,14 +156,13 @@ Item } } - Button + Cura.SecondaryButton { Layout.row: 2 Layout.column: 1 Layout.preferredWidth: width Layout.preferredHeight: height iconSource: UM.Theme.getIcon("House"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -192,10 +187,9 @@ Item horizontalAlignment: Text.AlignHCenter } - Button + Cura.SecondaryButton { iconSource: UM.Theme.getIcon("ChevronSingleUp"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -205,10 +199,9 @@ Item } } - Button + Cura.SecondaryButton { iconSource: UM.Theme.getIcon("House"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -218,10 +211,9 @@ Item } } - Button + Cura.SecondaryButton { iconSource: UM.Theme.getIcon("ChevronSingleDown"); - style: UM.Theme.styles.monitor_button_style width: height height: UM.Theme.getSize("setting_control").height @@ -270,8 +262,6 @@ Item checkable: true checked: distancesRow.currentDistance == model.value onClicked: distancesRow.currentDistance = model.value - - style: UM.Theme.styles.monitor_checkable_button_style } } } diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 857f066c39..d65873bfc1 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -372,233 +372,4 @@ QtObject } } } - - property Component print_setup_action_button: Component - { - ButtonStyle - { - background: Rectangle - { - border.width: UM.Theme.getSize("default_lining").width - border.color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_border"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active_border"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_border"); - } - else - { - return UM.Theme.getColor("action_button_border"); - } - } - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered"); - } - else - { - return UM.Theme.getColor("action_button"); - } - } - Behavior on color { ColorAnimation { duration: 50 } } - - implicitWidth: actualLabel.contentWidth + (UM.Theme.getSize("thick_margin").width * 2) - - Label - { - id: actualLabel - anchors.centerIn: parent - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_text"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active_text"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_text"); - } - else - { - return UM.Theme.getColor("action_button_text"); - } - } - font: UM.Theme.getFont("medium") - text: control.text - } - } - label: Item { } - } - } - - property Component monitor_button_style: Component - { - ButtonStyle - { - background: Rectangle - { - border.width: UM.Theme.getSize("default_lining").width - border.color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_border"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active_border"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_border"); - } - return UM.Theme.getColor("action_button_border"); - } - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered"); - } - return UM.Theme.getColor("action_button"); - } - Behavior on color - { - ColorAnimation - { - duration: 50 - } - } - } - - label: Item - { - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - width: Math.floor(control.width / 2) - height: Math.floor(control.height / 2) - sourceSize.height: width - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_text"); - } - else if(control.pressed) - { - return UM.Theme.getColor("action_button_active_text"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_text"); - } - return UM.Theme.getColor("action_button_text"); - } - source: control.iconSource - } - } - } - } - - property Component monitor_checkable_button_style: Component - { - ButtonStyle { - background: Rectangle { - border.width: control.checked ? UM.Theme.getSize("default_lining").width * 2 : UM.Theme.getSize("default_lining").width - border.color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_border"); - } - else if (control.checked || control.pressed) - { - return UM.Theme.getColor("action_button_active_border"); - } - else if(control.hovered) - { - return UM.Theme.getColor("action_button_hovered_border"); - } - return UM.Theme.getColor("action_button_border"); - } - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled"); - } - else if (control.checked || control.pressed) - { - return UM.Theme.getColor("action_button_active"); - } - else if (control.hovered) - { - return UM.Theme.getColor("action_button_hovered"); - } - return UM.Theme.getColor("action_button"); - } - Behavior on color { ColorAnimation { duration: 50; } } - Label { - anchors.left: parent.left - anchors.right: parent.right - anchors.verticalCenter: parent.verticalCenter - anchors.leftMargin: UM.Theme.getSize("default_lining").width * 2 - anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 - color: - { - if(!control.enabled) - { - return UM.Theme.getColor("action_button_disabled_text"); - } - else if (control.checked || control.pressed) - { - return UM.Theme.getColor("action_button_active_text"); - } - else if (control.hovered) - { - return UM.Theme.getColor("action_button_hovered_text"); - } - return UM.Theme.getColor("action_button_text"); - } - font: UM.Theme.getFont("default") - text: control.text - horizontalAlignment: Text.AlignHCenter - elide: Text.ElideMiddle - } - } - label: Item { } - } - } } From f2ee58a08bb470379e47e115f1d31a12f74369e0 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 19 Jan 2022 15:37:59 +0100 Subject: [PATCH 02/50] Update `PerObjectCategory` to QtQuick.Controls 2.1 CURA-8684 --- .../PerObjectCategory.qml | 68 +++++++++---------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectCategory.qml b/plugins/PerObjectSettingsTool/PerObjectCategory.qml index 58192f0acd..d23b0b9458 100644 --- a/plugins/PerObjectSettingsTool/PerObjectCategory.qml +++ b/plugins/PerObjectSettingsTool/PerObjectCategory.qml @@ -1,10 +1,8 @@ -// Copyright (c) 2015 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 -import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.1 import UM 1.1 as UM @@ -13,39 +11,38 @@ import ".." Button { id: base; - style: ButtonStyle { - background: Item { } - label: Row + background: Item { } + + contentItem: Row + { + spacing: UM.Theme.getSize("default_lining").width + + UM.RecolorImage { - spacing: UM.Theme.getSize("default_lining").width - - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - height: (label.height / 2) | 0 - width: height - source: control.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight"); - color: control.hovered ? palette.highlight : palette.buttonText - } - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - height: label.height - width: height - source: control.iconSource - color: control.hovered ? palette.highlight : palette.buttonText - } - Label - { - id: label - anchors.verticalCenter: parent.verticalCenter - text: control.text - color: control.hovered ? palette.highlight : palette.buttonText - font.bold: true - } - - SystemPalette { id: palette } + anchors.verticalCenter: parent.verticalCenter + height: (label.height / 2) | 0 + width: height + source: base.checked ? UM.Theme.getIcon("ChevronSingleDown") : UM.Theme.getIcon("ChevronSingleRight"); + color: base.hovered ? palette.highlight : palette.buttonText } + UM.RecolorImage + { + anchors.verticalCenter: parent.verticalCenter + height: label.height + width: height + source: UM.Theme.getIcon(definition.icon) + color: base.hovered ? palette.highlight : palette.buttonText + } + Label + { + id: label + anchors.verticalCenter: parent.verticalCenter + text: base.text + color: base.hovered ? palette.highlight : palette.buttonText + font.bold: true + } + + SystemPalette { id: palette } } signal showTooltip(string text); @@ -53,7 +50,6 @@ Button { signal contextMenuRequested() text: definition.label - iconSource: UM.Theme.getIcon(definition.icon) checkable: true checked: definition.expanded From 07095a5802189a19a865ee11056da0ab2b0d42dc Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 20 Jan 2022 22:38:00 +0100 Subject: [PATCH 03/50] Update Material selection and variant selection buttons to QtControls 2 CURA-8684 --- .../ConfigurationMenu/CustomConfiguration.qml | 14 +-- resources/qml/PrintSetupHeaderButton.qml | 104 ++++++++++++++++++ resources/themes/cura-light/styles.qml | 87 --------------- 3 files changed, 110 insertions(+), 95 deletions(-) create mode 100644 resources/qml/PrintSetupHeaderButton.qml diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index bacee0bc24..95026112ba 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -1,9 +1,8 @@ -// 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.6 import QtQuick.Controls 2.0 -import QtQuick.Controls 1.1 as OldControls import Cura 1.0 as Cura import UM 1.5 as UM @@ -262,7 +261,7 @@ Item width: selectors.textWidth } - OldControls.ToolButton + Cura.PrintSetupHeaderButton { id: materialSelection @@ -276,8 +275,8 @@ Item width: selectors.controlWidth height: parent.height - style: UM.Theme.styles.print_setup_header_button - activeFocusOnPress: true + focusPolicy: ClickFocus + Cura.MaterialMenu { id: materialsMenu @@ -324,15 +323,14 @@ Item width: selectors.textWidth } - OldControls.ToolButton + Cura.PrintSetupHeaderButton { id: variantSelection text: Cura.MachineManager.activeStack != null ? Cura.MachineManager.activeStack.variant.name : "" tooltip: text height: parent.height width: selectors.controlWidth - style: UM.Theme.styles.print_setup_header_button - activeFocusOnPress: true + focusPolicy: ClickFocus enabled: enabledCheckbox.checked Cura.NozzleMenu diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml new file mode 100644 index 0000000000..c0beac3205 --- /dev/null +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -0,0 +1,104 @@ +// Copyright (c) 2021 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.1 +import QtQuick.Controls 2.1 + +import Cura 1.0 as Cura +import UM 1.5 as UM + +ToolButton +{ + id: base + + property alias tooltip: tooltip.text + + contentItem: Label {} + + Cura.ToolTip + { + id: tooltip + visible: base.hovered + targetPoint: Qt.point(parent.x, Math.round(parent.y + parent.height / 2)) + } + + background: Rectangle + { + color: + { + if(base.enabled) + { + if(base.valueError) + { + return UM.Theme.getColor("setting_validation_error_background"); + } + else if(base.valueWarning) + { + return UM.Theme.getColor("setting_validation_warning_background"); + } + else + { + return UM.Theme.getColor("setting_control"); + } + } + else + { + return UM.Theme.getColor("setting_control_disabled"); + } + } + + radius: UM.Theme.getSize("setting_control_radius").width + border.width: UM.Theme.getSize("default_lining").width + border.color: + { + if (base.enabled) + { + if (base.valueError) + { + return UM.Theme.getColor("setting_validation_error"); + } + else if (base.valueWarning) + { + return UM.Theme.getColor("setting_validation_warning"); + } + else if (base.hovered) + { + return UM.Theme.getColor("setting_control_border_highlight"); + } + else + { + return UM.Theme.getColor("setting_control_border"); + } + } + else + { + return UM.Theme.getColor("setting_control_disabled_border"); + } + } + UM.RecolorImage + { + id: downArrow + anchors.verticalCenter: parent.verticalCenter + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_margin").width + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + sourceSize.height: width + color: base.enabled ? UM.Theme.getColor("setting_control_button") : UM.Theme.getColor("setting_category_disabled_text") + source: UM.Theme.getIcon("ChevronSingleDown") + } + Label + { + id: printSetupComboBoxLabel + color: base.enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") + text: base.text; + elide: Text.ElideRight; + anchors.left: parent.left; + anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width + anchors.right: downArrow.left; + anchors.rightMargin: base.rightMargin; + anchors.verticalCenter: parent.verticalCenter; + font: UM.Theme.getFont("default") + } + } +} diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index d65873bfc1..3ee943195d 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -9,93 +9,6 @@ import UM 1.1 as UM QtObject { - property Component print_setup_header_button: Component - { - ButtonStyle - { - background: Rectangle - { - color: - { - if(control.enabled) - { - if(control.valueError) - { - return UM.Theme.getColor("setting_validation_error_background"); - } - else if(control.valueWarning) - { - return UM.Theme.getColor("setting_validation_warning_background"); - } - else - { - return UM.Theme.getColor("setting_control"); - } - } - else - { - return UM.Theme.getColor("setting_control_disabled"); - } - } - - radius: UM.Theme.getSize("setting_control_radius").width - border.width: UM.Theme.getSize("default_lining").width - border.color: - { - if (control.enabled) - { - if (control.valueError) - { - return UM.Theme.getColor("setting_validation_error"); - } - else if (control.valueWarning) - { - return UM.Theme.getColor("setting_validation_warning"); - } - else if (control.hovered) - { - return UM.Theme.getColor("setting_control_border_highlight"); - } - else - { - return UM.Theme.getColor("setting_control_border"); - } - } - else - { - return UM.Theme.getColor("setting_control_disabled_border"); - } - } - UM.RecolorImage - { - id: downArrow - anchors.verticalCenter: parent.verticalCenter - anchors.right: parent.right - anchors.rightMargin: UM.Theme.getSize("default_margin").width - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - sourceSize.height: width - color: control.enabled ? UM.Theme.getColor("setting_control_button") : UM.Theme.getColor("setting_category_disabled_text") - source: UM.Theme.getIcon("ChevronSingleDown") - } - Label - { - id: printSetupComboBoxLabel - color: control.enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") - text: control.text; - elide: Text.ElideRight; - anchors.left: parent.left; - anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width - anchors.right: downArrow.left; - anchors.rightMargin: control.rightMargin; - anchors.verticalCenter: parent.verticalCenter; - font: UM.Theme.getFont("default") - } - } - label: Label{} - } - } - property Component tool_button: Component { ButtonStyle From bcd1689680e944082062c61b39a2ec54f96c3bf3 Mon Sep 17 00:00:00 2001 From: casper Date: Thu, 20 Jan 2022 22:58:43 +0100 Subject: [PATCH 04/50] Update buttons in per object settings plugin to QtControls 2 CURA-8684 --- .../PerObjectSettingsPanel.qml | 36 +++---- .../PerObjectSettingsTool/ToolBarButton.qml | 79 ++++++++++++++++ resources/themes/cura-light/styles.qml | 93 ------------------- 3 files changed, 94 insertions(+), 114 deletions(-) create mode 100644 plugins/PerObjectSettingsTool/ToolBarButton.qml diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index c97989c449..403dfa499d 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -2,7 +2,8 @@ // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.2 -import QtQuick.Controls 1.2 +import QtQuick.Controls 2.1 +import QtQuick.Controls 1.2 as OldControls import QtQuick.Controls.Styles 1.2 import UM 1.5 as UM @@ -76,7 +77,7 @@ Item id: meshTypeButtons spacing: UM.Theme.getSize("default_margin").width - Button + ToolBarButton { id: normalButton text: catalog.i18nc("@label", "Normal model") @@ -84,11 +85,10 @@ Item property bool needBorder: true checkable: true onClicked: setMeshType(normalMeshType); - style: UM.Theme.styles.tool_button; z: 4 } - Button + ToolBarButton { id: supportMeshButton text: catalog.i18nc("@label", "Print as support") @@ -96,11 +96,10 @@ Item property bool needBorder: true checkable:true onClicked: setMeshType(supportMeshType) - style: UM.Theme.styles.tool_button; z: 3 } - Button + ToolBarButton { id: overlapMeshButton text: catalog.i18nc("@label", "Modify settings for overlaps") @@ -108,11 +107,10 @@ Item property bool needBorder: true checkable:true onClicked: setMeshType(infillMeshType) - style: UM.Theme.styles.tool_button; z: 2 } - Button + ToolBarButton { id: antiOverhangMeshButton text: catalog.i18nc("@label", "Don't support overlaps") @@ -120,7 +118,6 @@ Item property bool needBorder: true checkable: true onClicked: setMeshType(antiOverhangMeshType) - style: UM.Theme.styles.tool_button; z: 1 } @@ -179,7 +176,7 @@ Item height: Math.min(contents.count * (UM.Theme.getSize("section").height + UM.Theme.getSize("default_lining").height), maximumHeight) visible: currentMeshType != "anti_overhang_mesh" - ScrollView + OldControls.ScrollView { height: parent.height width: UM.Theme.getSize("setting").width + UM.Theme.getSize("default_margin").width @@ -292,19 +289,16 @@ Item onClicked: addedSettingsModel.setVisible(model.key, false) - style: ButtonStyle + background: Item { - background: Item + UM.RecolorImage { - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - width: parent.width - height: width - sourceSize.height: width - color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button") - source: UM.Theme.getIcon("Minus") - } + anchors.verticalCenter: parent.verticalCenter + width: parent.width + height: width + sourceSize.height: width + color: parent.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button") + source: UM.Theme.getIcon("Minus") } } } diff --git a/plugins/PerObjectSettingsTool/ToolBarButton.qml b/plugins/PerObjectSettingsTool/ToolBarButton.qml new file mode 100644 index 0000000000..5e2479a73f --- /dev/null +++ b/plugins/PerObjectSettingsTool/ToolBarButton.qml @@ -0,0 +1,79 @@ +// Copyright (c) 2021 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.1 +import QtQuick.Controls 2.1 + +import Cura 1.0 as Cura +import UM 1.5 as UM + +ToolButton +{ + id: base + + property alias tooltip: tooltip.text + property alias iconSource: icon.source; + + Cura.ToolTip + { + id: tooltip + visible: base.hovered + targetPoint: Qt.point(parent.x, Math.round(parent.y + parent.height / 2)) + } + + + background: Item + { + implicitWidth: UM.Theme.getSize("button").width + implicitHeight: UM.Theme.getSize("button").height + + Rectangle + { + id: buttonFace + + anchors.fill: parent + property bool down: base.pressed || (base.checkable && base.checked) + + color: + { + if(base.customColor !== undefined && base.customColor !== null) + { + return base.customColor + } + else if(base.checkable && base.checked && base.hovered) + { + return UM.Theme.getColor("toolbar_button_active_hover") + } + else if(base.pressed || (base.checkable && base.checked)) + { + return UM.Theme.getColor("toolbar_button_active") + } + else if(base.hovered) + { + return UM.Theme.getColor("toolbar_button_hover") + } + return UM.Theme.getColor("toolbar_background") + } + Behavior on color { ColorAnimation { duration: 50; } } + + border.width: (base.hasOwnProperty("needBorder") && base.needBorder) ? UM.Theme.getSize("default_lining").width : 0 + border.color: base.checked ? UM.Theme.getColor("icon") : UM.Theme.getColor("lining") + } + } + + contentItem: Item + { + UM.RecolorImage + { + id: icon + + anchors.centerIn: parent + opacity: base.enabled ? 1.0 : 0.2 + width: UM.Theme.getSize("medium_button_icon").width + height: UM.Theme.getSize("medium_button_icon").height + color: UM.Theme.getColor("icon") + + sourceSize: UM.Theme.getSize("medium_button_icon") + } + } +} \ No newline at end of file diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 3ee943195d..d9932c1973 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -9,99 +9,6 @@ import UM 1.1 as UM QtObject { - property Component tool_button: Component - { - ButtonStyle - { - background: Item - { - implicitWidth: UM.Theme.getSize("button").width - implicitHeight: UM.Theme.getSize("button").height - - UM.PointingRectangle - { - id: button_tooltip - - anchors.left: parent.right - anchors.leftMargin: UM.Theme.getSize("button_tooltip_arrow").width * 2 - anchors.verticalCenter: parent.verticalCenter - - target: Qt.point(parent.x, y + Math.round(height/2)) - arrowSize: UM.Theme.getSize("button_tooltip_arrow").width - color: UM.Theme.getColor("button_tooltip") - opacity: control.hovered ? 1.0 : 0.0; - visible: control.text != "" - - width: control.hovered ? button_tip.width + UM.Theme.getSize("button_tooltip").width : 0 - height: UM.Theme.getSize("button_tooltip").height - - Behavior on width { NumberAnimation { duration: 100; } } - Behavior on opacity { NumberAnimation { duration: 100; } } - - Label - { - id: button_tip - - anchors.horizontalCenter: parent.horizontalCenter - anchors.verticalCenter: parent.verticalCenter - - text: control.text - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("tooltip_text") - } - } - - Rectangle - { - id: buttonFace - - anchors.fill: parent - property bool down: control.pressed || (control.checkable && control.checked) - - color: - { - if(control.customColor !== undefined && control.customColor !== null) - { - return control.customColor - } - else if(control.checkable && control.checked && control.hovered) - { - return UM.Theme.getColor("toolbar_button_active_hover") - } - else if(control.pressed || (control.checkable && control.checked)) - { - return UM.Theme.getColor("toolbar_button_active") - } - else if(control.hovered) - { - return UM.Theme.getColor("toolbar_button_hover") - } - return UM.Theme.getColor("toolbar_background") - } - Behavior on color { ColorAnimation { duration: 50; } } - - border.width: (control.hasOwnProperty("needBorder") && control.needBorder) ? UM.Theme.getSize("default_lining").width : 0 - border.color: control.checked ? UM.Theme.getColor("icon") : UM.Theme.getColor("lining") - } - } - - label: Item - { - UM.RecolorImage - { - anchors.centerIn: parent - opacity: control.enabled ? 1.0 : 0.2 - source: control.iconSource - width: UM.Theme.getSize("medium_button_icon").width - height: UM.Theme.getSize("medium_button_icon").height - color: UM.Theme.getColor("icon") - - sourceSize: UM.Theme.getSize("medium_button_icon") - } - } - } - } - property Component progressbar: Component { ProgressBarStyle From ee38c9c05b53cb999f7b60ea71ddc6dc07bd7840 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 21 Jan 2022 12:24:40 +0100 Subject: [PATCH 05/50] Update QtControls to v2.0 in image reader plugin CURA-8684 --- plugins/ImageReader/ConfigUI.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index a3dceed50d..43d932f790 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -1,8 +1,8 @@ -// Copyright (c) 2015 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.0 import QtQuick.Layouts 1.1 import QtQuick.Window 2.1 @@ -210,7 +210,7 @@ UM.Dialog Slider { id: smoothing objectName: "Smoothing" - maximumValue: 100.0 + to: 100.0 stepSize: 1.0 width: 180 onValueChanged: { manager.onSmoothingChanged(value) } From 092936ae3a8616e05a45d1407d067f061bb814bd Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 21 Jan 2022 13:06:51 +0100 Subject: [PATCH 06/50] Update Buttons to QtControls 2.0 in general preferences page CURA-8684 --- resources/qml/Preferences/GeneralPage.qml | 27 +++++++++++++---------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index db0c8e2d23..f7c19cd27d 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -2,11 +2,10 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.1 +import QtQuick.Controls 1.1 as OldControls +import QtQuick.Controls 2.3 import QtQuick.Layouts 1.1 -import QtQuick.Controls 2.3 as NewControls - import UM 1.1 as UM import Cura 1.1 as Cura @@ -125,7 +124,7 @@ UM.PreferencesPage pluginNotificationsUpdateCheckbox.checked = boolCheck(UM.Preferences.getValue("info/automatic_plugin_update_check")) } - ScrollView + OldControls.ScrollView { width: parent.width height: parent.height @@ -186,7 +185,7 @@ UM.PreferencesPage } } - NewControls.ComboBox + ComboBox { id: languageComboBox @@ -240,7 +239,7 @@ UM.PreferencesPage } } - NewControls.ComboBox + ComboBox { id: themeComboBox @@ -516,7 +515,7 @@ UM.PreferencesPage } } - NewControls.ComboBox + ComboBox { id: cameraComboBox @@ -673,7 +672,7 @@ UM.PreferencesPage text: catalog.i18nc("@window:text", "Default behavior when opening a project file: ") } - NewControls.ComboBox + ComboBox { id: choiceOnOpenProjectDropDownButton width: Math.round(250 * screenScaleFactor) @@ -740,7 +739,7 @@ UM.PreferencesPage text: catalog.i18nc("@window:text", "Default behavior for changed setting values when switching to a different profile: ") } - NewControls.ComboBox + ComboBox { id: choiceOnProfileOverrideDropDownButton width: Math.round(250 * screenScaleFactor) @@ -843,7 +842,11 @@ UM.PreferencesPage } } - ExclusiveGroup { id: curaUpdatesGroup } + ButtonGroup { + id: curaUpdatesGroup + buttons: [checkUpdatesOptionBeta, checkUpdatesOptionStable] + } + UM.TooltipArea { width: childrenRect.width @@ -853,8 +856,8 @@ UM.PreferencesPage anchors.leftMargin: UM.Theme.getSize("default_margin").width RadioButton { + id: checkUpdatesOptionStable text: catalog.i18nc("@option:radio", "Stable releases only") - exclusiveGroup: curaUpdatesGroup enabled: checkUpdatesCheckbox.checked checked: UM.Preferences.getValue("info/latest_update_source") == "stable" onClicked: UM.Preferences.setValue("info/latest_update_source", "stable") @@ -869,8 +872,8 @@ UM.PreferencesPage anchors.leftMargin: UM.Theme.getSize("default_margin").width RadioButton { + id: checkUpdatesOptionBeta text: catalog.i18nc("@option:radio", "Stable and Beta releases") - exclusiveGroup: curaUpdatesGroup enabled: checkUpdatesCheckbox.checked checked: UM.Preferences.getValue("info/latest_update_source") == "beta" onClicked: UM.Preferences.setValue("info/latest_update_source", "beta") From 09793854ef92ccf2bd745fc4cba3906a405b5143 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 21 Jan 2022 13:38:58 +0100 Subject: [PATCH 07/50] Update Buttons to QtControls 2.0 in per model settings dialog CURA-8684 --- plugins/PerObjectSettingsTool/SettingPickDialog.qml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index 18f36b2651..0e9202a900 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -1,5 +1,9 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Uranium is released under the terms of the LGPLv3 or higher. + import QtQuick 2.2 -import QtQuick.Controls 1.2 +import QtQuick.Controls 1.2 as OldControls +import QtQuick.Controls 2.0 import UM 1.2 as UM import Cura 1.0 as Cura @@ -67,7 +71,7 @@ UM.Dialog text: catalog.i18nc("@label:checkbox", "Show all") } - ScrollView + OldControls.ScrollView { id: scrollView From 8cc1604b2f6e102dca572a941ab019e83e66d7b6 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 21 Jan 2022 14:07:41 +0100 Subject: [PATCH 08/50] Update Buttons to QtControls 2.0 in the simulation view expend menu bar CURA-8684 --- .../SimulationViewMenuComponent.qml | 54 ++++++++++++++++-- resources/themes/cura-light/styles.qml | 55 ------------------- 2 files changed, 50 insertions(+), 59 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 6addaa6dc5..e40f7d0e4b 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -1,10 +1,9 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.4 import QtQuick.Layouts 1.1 -import QtQuick.Controls 1.0 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.1 import QtGraphicalEffects 1.0 import UM 1.5 as UM @@ -133,7 +132,54 @@ Cura.ExpandableComponent width: parent.width model: layerViewTypes visible: !UM.SimulationView.compatibilityMode - style: UM.Theme.styles.combobox + + background: Rectangle + { + implicitHeight: UM.Theme.getSize("setting_control").height; + implicitWidth: UM.Theme.getSize("setting_control").width; + + color: ladyerTypeCombobox.hovered ? UM.Theme.getColor("setting_control_highlight") : UM.Theme.getColor("setting_control") + Behavior on color { ColorAnimation { duration: 50; } } + + border.width: UM.Theme.getSize("default_lining").width; + border.color: ladyerTypeCombobox.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border"); + radius: UM.Theme.getSize("setting_control_radius").width + } + + contentItem: Item + { + Label + { + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_lining").width + anchors.right: downArrow.left + anchors.rightMargin: UM.Theme.getSize("default_lining").width + anchors.verticalCenter: parent.verticalCenter + + text: ladyerTypeCombobox.currentText + font: UM.Theme.getFont("default"); + color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") + + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter + } + + UM.RecolorImage + { + id: downArrow + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 + anchors.verticalCenter: parent.verticalCenter + + source: UM.Theme.getIcon("ChevronSingleDown") + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + sourceSize.width: width + 5 * screenScaleFactor + sourceSize.height: width + 5 * screenScaleFactor + + color: UM.Theme.getColor("setting_control_button"); + } + } onActivated: { diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index d9932c1973..11dd2a70eb 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -88,61 +88,6 @@ QtObject } } - property Component combobox: Component - { - ComboBoxStyle - { - - background: Rectangle - { - implicitHeight: UM.Theme.getSize("setting_control").height; - implicitWidth: UM.Theme.getSize("setting_control").width; - - color: control.hovered ? UM.Theme.getColor("setting_control_highlight") : UM.Theme.getColor("setting_control") - Behavior on color { ColorAnimation { duration: 50; } } - - border.width: UM.Theme.getSize("default_lining").width; - border.color: control.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border"); - radius: UM.Theme.getSize("setting_control_radius").width - } - - label: Item - { - Label - { - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_lining").width - anchors.right: downArrow.left - anchors.rightMargin: UM.Theme.getSize("default_lining").width - anchors.verticalCenter: parent.verticalCenter - - text: control.currentText - font: UM.Theme.getFont("default"); - color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") - - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - - UM.RecolorImage - { - id: downArrow - anchors.right: parent.right - anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 - anchors.verticalCenter: parent.verticalCenter - - source: UM.Theme.getIcon("ChevronSingleDown") - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor - - color: UM.Theme.getColor("setting_control_button"); - } - } - } - } - property Component partially_checkbox: Component { CheckBoxStyle From 582e4fcbd09f280864d211211380fe1e4b32093b Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 10:31:17 +0100 Subject: [PATCH 09/50] Update print action hotkey listener to QtControls 2 CURA-8684 --- resources/qml/ActionPanel/SliceProcessWidget.qml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/resources/qml/ActionPanel/SliceProcessWidget.qml b/resources/qml/ActionPanel/SliceProcessWidget.qml index 99d78537c3..868f23d242 100644 --- a/resources/qml/ActionPanel/SliceProcessWidget.qml +++ b/resources/qml/ActionPanel/SliceProcessWidget.qml @@ -1,10 +1,9 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 2.1 +import QtQuick.Controls 2.4 import QtQuick.Layouts 1.3 -import QtQuick.Controls 1.4 as Controls1 import UM 1.4 as UM import Cura 1.0 as Cura @@ -122,7 +121,9 @@ Column tooltip: catalog.i18nc("@label", "Start the slicing process") enabled: widget.backendState != UM.Backend.Error && !widget.waitingForSliceToStart visible: widget.backendState == UM.Backend.NotStarted || widget.backendState == UM.Backend.Error - onClicked: sliceOrStopSlicing() + onClicked: { + sliceOrStopSlicing() + } } Cura.SecondaryButton @@ -136,7 +137,9 @@ Column text: catalog.i18nc("@button", "Cancel") enabled: sliceButton.enabled visible: !sliceButton.visible - onClicked: sliceOrStopSlicing() + onClicked: { + sliceOrStopSlicing() + } } } @@ -165,7 +168,7 @@ Column } // Shortcut for "slice/stop" - Controls1.Action + Action { shortcut: "Ctrl+P" onTriggered: From 9e5fd998f4df2adf9aa503b3709f45b2e68673a0 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 14:11:02 +0100 Subject: [PATCH 10/50] Update open files dialog to QtControls 2 CURA-8684 --- .../OpenFilesIncludingProjectsDialog.qml | 73 +++++++++---------- 1 file changed, 35 insertions(+), 38 deletions(-) diff --git a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml index 3f1900c66b..08d10bbfff 100644 --- a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml +++ b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml @@ -1,9 +1,8 @@ -// 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.2 -import QtQuick.Controls 1.1 -import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.0 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Window 2.1 @@ -69,45 +68,43 @@ UM.Dialog width: height } - // Buttons - Item - { - anchors.right: parent.right - anchors.left: parent.left - height: childrenRect.height - - Button - { - id: cancelButton - text: catalog.i18nc("@action:button", "Cancel"); - anchors.right: importAllAsModelsButton.left - onClicked: - { - // cancel - base.hide(); - } - } - - Button - { - id: importAllAsModelsButton - text: catalog.i18nc("@action:button", "Import all as models"); - anchors.right: parent.right - isDefault: true - onClicked: - { - // load models from all selected file - loadModelFiles(base.fileUrls); - - base.hide(); - } - } - } - UM.I18nCatalog { id: catalog name: "cura" } + + ButtonGroup { + buttons: [cancelButton, importAllAsModelsButton] + checkedButton: importAllAsModelsButton + } } + + onAccepted: loadModelFiles(base.fileUrls) + + // Buttons + rightButtons: + [ + Button + { + id: cancelButton + text: catalog.i18nc("@action:button", "Cancel"); + onClicked: + { + // cancel + base.hide(); + } + }, + Button + { + id: importAllAsModelsButton + text: catalog.i18nc("@action:button", "Import all as models"); + onClicked: + { + // load models from all selected file + loadModelFiles(base.fileUrls); + base.hide(); + } + } + ] } \ No newline at end of file From 4c0ee058e43665d7ace0ec8c262a90558508c378 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 18:21:52 +0100 Subject: [PATCH 11/50] Update discard keep or discard changes dialog to QtControls 2 CURA-8684 --- .../DiscardOrKeepProfileChangesDialog.qml | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index 0a9d317d2d..140efe8c5c 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -1,9 +1,9 @@ -// Copyright (c) 2020 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -import QtQuick.Controls 1.1 -import QtQuick.Controls 2.15 as NewControls +import QtQuick.Controls 1.1 as OldControls +import QtQuick.Controls 2.15 import QtQuick.Dialogs 1.2 import QtQuick.Window 2.1 @@ -15,6 +15,9 @@ UM.Dialog id: base title: catalog.i18nc("@title:window", "Discard or Keep changes") + onAccepted: CuraApplication.discardOrKeepProfileChangesClosed("discard") + onRejected: CuraApplication.discardOrKeepProfileChangesClosed("keep") + minimumWidth: UM.Theme.getSize("popup_dialog").width minimumHeight: UM.Theme.getSize("popup_dialog").height property var changesModel: Cura.UserChangesModel{ id: userChangesModel} @@ -44,7 +47,6 @@ UM.Dialog anchors.margins: UM.Theme.getSize("default_margin").width anchors.left: parent.left anchors.right: parent.right - anchors.top: parent.top spacing: UM.Theme.getSize("default_margin").width UM.I18nCatalog @@ -68,7 +70,7 @@ UM.Dialog anchors.bottom: optionRow.top anchors.left: parent.left anchors.right: parent.right - TableView + OldControls.TableView { anchors.fill: parent height: base.height - 150 @@ -106,21 +108,21 @@ UM.Dialog } } - TableViewColumn + OldControls.TableViewColumn { role: "label" title: catalog.i18nc("@title:column", "Profile settings") delegate: labelDelegate width: (tableView.width * 0.4) | 0 } - TableViewColumn + OldControls.TableViewColumn { role: "original_value" title: Cura.MachineManager.activeQualityDisplayNameMap["main"] width: (tableView.width * 0.3) | 0 delegate: defaultDelegate } - TableViewColumn + OldControls.TableViewColumn { role: "user_value" title: catalog.i18nc("@title:column", "Current changes") @@ -140,13 +142,13 @@ UM.Dialog Item { id: optionRow - anchors.bottom: buttonsRow.top + anchors.bottom: parent.bottom anchors.right: parent.right anchors.left: parent.left anchors.margins: UM.Theme.getSize("default_margin").width height: childrenRect.height - NewControls.ComboBox + ComboBox { id: discardOrKeepProfileChangesDropDownButton width: 300 @@ -186,37 +188,33 @@ UM.Dialog Item { - id: buttonsRow - anchors.bottom: parent.bottom - anchors.right: parent.right - anchors.left: parent.left - anchors.margins: UM.Theme.getSize("default_margin").width - height: childrenRect.height + ButtonGroup + { + buttons: [discardButton, keepButton] + checkedButton: discardButton + } + } + rightButtons: [ Button { id: discardButton text: catalog.i18nc("@action:button", "Discard changes"); - anchors.right: parent.right onClicked: { CuraApplication.discardOrKeepProfileChangesClosed("discard") base.hide() } - isDefault: true - } - + }, Button { id: keepButton text: catalog.i18nc("@action:button", "Keep changes"); - anchors.right: discardButton.left - anchors.rightMargin: UM.Theme.getSize("default_margin").width onClicked: { CuraApplication.discardOrKeepProfileChangesClosed("keep") base.hide() } } - } + ] } From b45707af54a456f42b5803c7080c3f3467de0e85 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 21:58:23 +0100 Subject: [PATCH 12/50] Update ask open project or models dialog to QtControls 2 CURA-8684 --- .../AskOpenAsProjectOrModelsDialog.qml | 51 ++++++++++--------- 1 file changed, 27 insertions(+), 24 deletions(-) diff --git a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml index 4890f79210..725b25e1e1 100644 --- a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml +++ b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml @@ -1,8 +1,8 @@ -// 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.2 -import QtQuick.Controls 1.1 +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Window 2.1 @@ -97,29 +97,32 @@ UM.Dialog text: catalog.i18nc("@text:window", "Remember my choice") checked: UM.Preferences.getValue("cura/choice_on_open_project") != "always_ask" } + } - // Buttons - Item { - id: buttonBar - anchors.right: parent.right - anchors.left: parent.left - height: childrenRect.height - - Button { - id: openAsProjectButton - text: catalog.i18nc("@action:button", "Open as project") - anchors.right: importModelsButton.left - anchors.rightMargin: UM.Theme.getSize("default_margin").width - isDefault: true - onClicked: loadProjectFile() - } - - Button { - id: importModelsButton - text: catalog.i18nc("@action:button", "Import models") - anchors.right: parent.right - onClicked: loadModelFiles() - } + Item + { + ButtonGroup + { + buttons: [openAsProjectButton, importModelsButton] + checkedButton: openAsProjectButton } } + + onAccepted: loadProjectFile() + onRejected: loadModelFiles() + + rightButtons: [ + Button + { + id: openAsProjectButton + text: catalog.i18nc("@action:button", "Open as project") + onClicked: loadProjectFile() + }, + Button + { + id: importModelsButton + text: catalog.i18nc("@action:button", "Import models") + onClicked: loadModelFiles() + } + ] } From 3e98282871fe8c097068f864567ab4a4b7c9f04d Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 22:31:36 +0100 Subject: [PATCH 13/50] Update material preferences page to QtControls 2 CURA-8684 --- .../Preferences/Materials/MaterialsPage.qml | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsPage.qml b/resources/qml/Preferences/Materials/MaterialsPage.qml index 6ec23f001f..20688c0b1b 100644 --- a/resources/qml/Preferences/Materials/MaterialsPage.qml +++ b/resources/qml/Preferences/Materials/MaterialsPage.qml @@ -2,7 +2,8 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 +import QtQuick.Controls 1.4 as OldControls +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 @@ -106,7 +107,7 @@ Item { id: activateMenuButton text: catalog.i18nc("@action:button", "Activate") - iconName: "list-activate" + icon.name: "list-activate" enabled: !isCurrentItemActivated && Cura.MachineManager.activeMachine.hasMaterials onClicked: { @@ -124,7 +125,7 @@ Item { id: createMenuButton text: catalog.i18nc("@action:button", "Create") - iconName: "list-add" + icon.name: "list-add" enabled: Cura.MachineManager.activeMachine.hasMaterials onClicked: { @@ -139,7 +140,7 @@ Item { id: duplicateMenuButton text: catalog.i18nc("@action:button", "Duplicate"); - iconName: "list-add" + icon.name: "list-add" enabled: base.hasCurrentItem onClicked: { @@ -154,7 +155,7 @@ Item { id: removeMenuButton text: catalog.i18nc("@action:button", "Remove") - iconName: "list-remove" + icon.name: "list-remove" enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated && base.materialManagementModel.canMaterialBeRemoved(base.currentItem.container_node) onClicked: @@ -169,7 +170,7 @@ Item { id: importMenuButton text: catalog.i18nc("@action:button", "Import") - iconName: "document-import" + icon.name: "document-import" onClicked: { forceActiveFocus(); @@ -183,7 +184,7 @@ Item { id: exportMenuButton text: catalog.i18nc("@action:button", "Export") - iconName: "document-export" + icon.name: "document-export" onClicked: { forceActiveFocus(); @@ -197,7 +198,7 @@ Item { id: syncMaterialsButton text: catalog.i18nc("@action:button Sending materials to printers", "Sync with Printers") - iconName: "sync-synchronizing" + icon.name: "sync-synchronizing" onClicked: { forceActiveFocus(); @@ -261,7 +262,7 @@ Item elide: Text.ElideRight } - ScrollView + OldControls.ScrollView { id: materialScrollView anchors From b6e375a3bed4dfa7c0f4d71e66376963c71ae7fd Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 22:34:14 +0100 Subject: [PATCH 14/50] Update machines preferences page to QtControls 2 CURA-8684 --- resources/qml/Preferences/MachinesPage.qml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index a6acfa0566..aa5b275501 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -1,8 +1,8 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.1 import QtQuick.Window 2.1 import UM 1.5 as UM @@ -38,7 +38,7 @@ UM.ManagementPage { id: activateMenuButton text: catalog.i18nc("@action:button", "Activate"); - iconName: "list-activate"; + icon.name: "list-activate"; enabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMachine.id onClicked: Cura.MachineManager.setActiveMachine(base.currentItem.id) }, @@ -46,14 +46,14 @@ UM.ManagementPage { id: addMenuButton text: catalog.i18nc("@action:button", "Add"); - iconName: "list-add"; + icon.name: "list-add"; onClicked: Cura.Actions.addMachine.trigger() }, Button { id: removeMenuButton text: catalog.i18nc("@action:button", "Remove"); - iconName: "list-remove"; + icon.name: "list-remove"; enabled: base.currentItem != null && model.count > 1 onClicked: confirmDialog.open(); }, @@ -61,7 +61,7 @@ UM.ManagementPage { id: renameMenuButton text: catalog.i18nc("@action:button", "Rename"); - iconName: "edit-rename"; + icon.name: "edit-rename"; enabled: base.currentItem != null && base.currentItem.metadata.group_name == null onClicked: renameDialog.open(); } @@ -125,7 +125,7 @@ UM.ManagementPage rightButtons: Button { text: catalog.i18nc("@action:button", "Close") - iconName: "dialog-close" + icon.name: "dialog-close" onClicked: actionDialog.reject() } } From 6dc535063b41d1b374cbf6f976ffb66329bc39f3 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 22:37:39 +0100 Subject: [PATCH 15/50] Update profiles preferences page to QtControls 2 CURA-8684 --- resources/qml/Preferences/ProfilesPage.qml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 9144d4dbe1..5176b4c188 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -2,7 +2,8 @@ // Uranium is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 +import QtQuick.Controls 1.4 as OldControls +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 @@ -82,7 +83,7 @@ Item { id: activateMenuButton text: catalog.i18nc("@action:button", "Activate") - iconName: "list-activate" + icon.name: "list-activate" enabled: !isCurrentItemActivated && base.currentItem onClicked: { @@ -102,7 +103,7 @@ Item { id: createMenuButton text: catalog.i18nc("@label", "Create") - iconName: "list-add" + icon.name: "list-add" enabled: base.canCreateProfile && !Cura.MachineManager.stacksHaveErrors visible: base.canCreateProfile @@ -119,7 +120,7 @@ Item { id: duplicateMenuButton text: catalog.i18nc("@label", "Duplicate") - iconName: "list-add" + icon.name: "list-add" enabled: !base.canCreateProfile visible: !base.canCreateProfile @@ -136,7 +137,7 @@ Item { id: removeMenuButton text: catalog.i18nc("@action:button", "Remove") - iconName: "list-remove" + icon.name: "list-remove" enabled: base.hasCurrentItem && !base.currentItem.is_read_only && !base.isCurrentItemActivated onClicked: { @@ -150,7 +151,7 @@ Item { id: renameMenuButton text: catalog.i18nc("@action:button", "Rename") - iconName: "edit-rename" + icon.name: "edit-rename" enabled: base.hasCurrentItem && !base.currentItem.is_read_only onClicked: { @@ -165,7 +166,7 @@ Item { id: importMenuButton text: catalog.i18nc("@action:button", "Import") - iconName: "document-import" + icon.name: "document-import" onClicked: { importDialog.open(); @@ -177,7 +178,7 @@ Item { id: exportMenuButton text: catalog.i18nc("@action:button", "Export") - iconName: "document-export" + icon.name: "document-export" enabled: base.hasCurrentItem && !base.currentItem.is_read_only onClicked: { @@ -401,7 +402,7 @@ Item elide: Text.ElideRight } - ScrollView + OldControls.ScrollView { id: profileScrollView anchors @@ -594,7 +595,7 @@ Item } } - TabView + OldControls.TabView { anchors.left: parent.left anchors.top: profileNotices.visible ? profileNotices.bottom : profileNotices.anchors.top From b47c7c9395f51a0c3cf1d6f368b795ca3c901d17 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 23:28:25 +0100 Subject: [PATCH 16/50] Update materials view preference menu to QtControls 2 CURA-8684 --- .../Preferences/Materials/MaterialsView.qml | 50 +++++++++++++------ 1 file changed, 36 insertions(+), 14 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 2c68973e55..aca8af0cda 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -1,8 +1,9 @@ -// Copyright (c) 2017 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.1 +import QtQuick.Controls 1.4 as OldControls import QtQuick.Dialogs 1.2 import UM 1.2 as UM @@ -10,7 +11,7 @@ import Cura 1.0 as Cura import ".." // Access to ReadOnlyTextArea.qml -TabView +OldControls.TabView { id: base @@ -67,13 +68,13 @@ TabView } } - Tab + OldControls.Tab { title: catalog.i18nc("@title", "Information") anchors.margins: UM.Theme.getSize("default_margin").width - ScrollView + OldControls.ScrollView { id: scrollView anchors.fill: parent @@ -262,13 +263,25 @@ TabView id: spoolCostSpinBox width: scrollView.columnWidth value: base.getMaterialPreferenceValue(properties.guid, "spool_cost") - prefix: base.currency + " " - decimals: 2 - maximumValue: 100000000 + to: 100000000 + editable: true + + property int decimals: 2 + + valueFromText: function(text) { + // remove all non-number tokens from input string so value can be parsed correctly + var value = Number(text.replace(/[^0-9.-]+/g, "")); + var precision = Math.pow(10, spoolCostSpinBox.decimals); + return Math.round(value * precision) / precision; + } + + textFromValue: function(value) { + return base.currency + " " + value.toFixed(spoolCostSpinBox.decimals) + } onValueChanged: { - base.setMaterialPreferenceValue(properties.guid, "spool_cost", parseFloat(value)) + base.setMaterialPreferenceValue(properties.guid, "spool_cost", parseFloat(value, decimals)) updateCostPerMeter() } } @@ -279,10 +292,19 @@ TabView id: spoolWeightSpinBox width: scrollView.columnWidth value: base.getMaterialPreferenceValue(properties.guid, "spool_weight", Cura.ContainerManager.getContainerMetaDataEntry(properties.container_id, "properties/weight")) - suffix: " g" stepSize: 100 - decimals: 0 - maximumValue: 10000 + to: 10000 + editable: true + + valueFromText: function(text, locale) { + // remove all non-number tokens from input string so value can be parsed correctly + var value = Number(text.replace(/[^0-9.-]+/g, "")); + return Math.round(value); + } + + textFromValue: function(value, locale) { + return value + " g" + } onValueChanged: { @@ -369,7 +391,7 @@ TabView } } - Tab + OldControls.Tab { title: catalog.i18nc("@label", "Print settings") anchors @@ -380,7 +402,7 @@ TabView rightMargin: 0 } - ScrollView + OldControls.ScrollView { anchors.fill: parent; From c63b94375d973a2ed46181157ba9c932b0195ec6 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 24 Jan 2022 23:34:38 +0100 Subject: [PATCH 17/50] Update materials slot preference menu to QtControls 2 CURA-8684 --- resources/qml/Preferences/Materials/MaterialsSlot.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsSlot.qml b/resources/qml/Preferences/Materials/MaterialsSlot.qml index c80d2f2093..52728181b6 100644 --- a/resources/qml/Preferences/Materials/MaterialsSlot.qml +++ b/resources/qml/Preferences/Materials/MaterialsSlot.qml @@ -1,8 +1,8 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 From d3f01034a2b3afe9de47c38d02ff35982cb4452a Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 25 Jan 2022 10:54:09 +0100 Subject: [PATCH 18/50] Highight default action and listen to keyboard actions in image dialog CURA-8684 --- plugins/ImageReader/ConfigUI.qml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index 43d932f790..1195f0c046 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -220,20 +220,30 @@ UM.Dialog } } + Item + { + ButtonGroup + { + buttons: [ok_button, cancel_button] + checkedButton: ok_button + } + } + + onAccepted: manager.onOkButtonClicked() + onRejected: manager.onCancelButtonClicked() + rightButtons: [ Button { id:ok_button text: catalog.i18nc("@action:button","OK"); - onClicked: { manager.onOkButtonClicked() } - enabled: true + onClicked: manager.onOkButtonClicked() }, Button { id:cancel_button text: catalog.i18nc("@action:button","Cancel"); - onClicked: { manager.onCancelButtonClicked() } - enabled: true + onClicked: manager.onCancelButtonClicked() } ] } From f834e63413aed5c44996399a622f031449a6fe38 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Tue, 25 Jan 2022 15:54:33 +0100 Subject: [PATCH 19/50] Update plugins/PerObjectSettingsTool/ToolBarButton.qml Co-authored-by: Jaime van Kessel --- plugins/PerObjectSettingsTool/ToolBarButton.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PerObjectSettingsTool/ToolBarButton.qml b/plugins/PerObjectSettingsTool/ToolBarButton.qml index 5e2479a73f..3bf38d19be 100644 --- a/plugins/PerObjectSettingsTool/ToolBarButton.qml +++ b/plugins/PerObjectSettingsTool/ToolBarButton.qml @@ -54,7 +54,7 @@ ToolButton } return UM.Theme.getColor("toolbar_background") } - Behavior on color { ColorAnimation { duration: 50; } } + Behavior on color { ColorAnimation { duration: 50 } } border.width: (base.hasOwnProperty("needBorder") && base.needBorder) ? UM.Theme.getSize("default_lining").width : 0 border.color: base.checked ? UM.Theme.getColor("icon") : UM.Theme.getColor("lining") From ea60fdeacd7165c38961491e8eed565f8450bea5 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Tue, 25 Jan 2022 15:59:17 +0100 Subject: [PATCH 20/50] Update resources/qml/Preferences/MachinesPage.qml Co-authored-by: Jaime van Kessel --- resources/qml/Preferences/MachinesPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index aa5b275501..fc229cab7b 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -38,7 +38,7 @@ UM.ManagementPage { id: activateMenuButton text: catalog.i18nc("@action:button", "Activate"); - icon.name: "list-activate"; + icon.name: "list-activate" enabled: base.currentItem != null && base.currentItem.id != Cura.MachineManager.activeMachine.id onClicked: Cura.MachineManager.setActiveMachine(base.currentItem.id) }, From ad3832791c184489b2e4bf9ac578621959359b90 Mon Sep 17 00:00:00 2001 From: casper Date: Tue, 25 Jan 2022 16:05:49 +0100 Subject: [PATCH 21/50] Use Button in tool bar button component CURA-8684 --- plugins/PerObjectSettingsTool/ToolBarButton.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/PerObjectSettingsTool/ToolBarButton.qml b/plugins/PerObjectSettingsTool/ToolBarButton.qml index 5e2479a73f..5a96d7cd19 100644 --- a/plugins/PerObjectSettingsTool/ToolBarButton.qml +++ b/plugins/PerObjectSettingsTool/ToolBarButton.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.1 @@ -7,7 +7,7 @@ import QtQuick.Controls 2.1 import Cura 1.0 as Cura import UM 1.5 as UM -ToolButton +Button { id: base From a3edf9e3e3a8158f1cc086523f667a4e66ced7dc Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Tue, 25 Jan 2022 22:33:51 +0100 Subject: [PATCH 22/50] Update resources/qml/Preferences/MachinesPage.qml Co-authored-by: Jaime van Kessel --- resources/qml/Preferences/MachinesPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index fc229cab7b..e88cd954ff 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -53,7 +53,7 @@ UM.ManagementPage { id: removeMenuButton text: catalog.i18nc("@action:button", "Remove"); - icon.name: "list-remove"; + icon.name: "list-remove" enabled: base.currentItem != null && model.count > 1 onClicked: confirmDialog.open(); }, From 95c79e7921f2189f0b07d508518203a3d85568d5 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Tue, 25 Jan 2022 22:37:39 +0100 Subject: [PATCH 23/50] Update resources/qml/Preferences/MachinesPage.qml Co-authored-by: Jaime van Kessel --- resources/qml/Preferences/MachinesPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index e88cd954ff..1f01fc4bb0 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -61,7 +61,7 @@ UM.ManagementPage { id: renameMenuButton text: catalog.i18nc("@action:button", "Rename"); - icon.name: "edit-rename"; + icon.name: "edit-rename" enabled: base.currentItem != null && base.currentItem.metadata.group_name == null onClicked: renameDialog.open(); } From 26bd68d891d7cc493306f6fafa6b2ca116655e40 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Tue, 25 Jan 2022 22:38:02 +0100 Subject: [PATCH 24/50] Update resources/qml/Preferences/MachinesPage.qml Co-authored-by: Jaime van Kessel --- resources/qml/Preferences/MachinesPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/MachinesPage.qml b/resources/qml/Preferences/MachinesPage.qml index 1f01fc4bb0..166e6c4346 100644 --- a/resources/qml/Preferences/MachinesPage.qml +++ b/resources/qml/Preferences/MachinesPage.qml @@ -46,7 +46,7 @@ UM.ManagementPage { id: addMenuButton text: catalog.i18nc("@action:button", "Add"); - icon.name: "list-add"; + icon.name: "list-add" onClicked: Cura.Actions.addMachine.trigger() }, Button From b51c787f622db64b964767754e932fb20d0ac183 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 26 Jan 2022 08:56:33 +0100 Subject: [PATCH 25/50] Re-use `Cura.ToolbarButton` in per object settings menu CURA-8684 --- .../PerObjectSettingsPanel.qml | 32 ++++++-- .../PerObjectSettingsTool/ToolBarButton.qml | 79 ------------------- 2 files changed, 24 insertions(+), 87 deletions(-) delete mode 100644 plugins/PerObjectSettingsTool/ToolBarButton.qml diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index 403dfa499d..6076d7392b 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -77,44 +77,60 @@ Item id: meshTypeButtons spacing: UM.Theme.getSize("default_margin").width - ToolBarButton + Cura.ToolbarButton { id: normalButton text: catalog.i18nc("@label", "Normal model") - iconSource: UM.Theme.getIcon("Infill0"); + toolItem: UM.RecolorImage + { + source: UM.Theme.getIcon("Infill0") + color: UM.Theme.getColor("icon") + } property bool needBorder: true checkable: true onClicked: setMeshType(normalMeshType); z: 4 } - ToolBarButton + Cura.ToolbarButton { id: supportMeshButton text: catalog.i18nc("@label", "Print as support") - iconSource: UM.Theme.getIcon("MeshTypeSupport"); + toolItem: UM.RecolorImage + { + source: UM.Theme.getIcon("MeshTypeSupport") + color: UM.Theme.getColor("icon") + } property bool needBorder: true checkable:true onClicked: setMeshType(supportMeshType) z: 3 } - ToolBarButton + Cura.ToolbarButton { id: overlapMeshButton text: catalog.i18nc("@label", "Modify settings for overlaps") - iconSource: UM.Theme.getIcon("MeshTypeIntersect"); + toolItem: UM.RecolorImage + { + source: UM.Theme.getIcon("MeshTypeIntersect") + color: UM.Theme.getColor("icon") + } property bool needBorder: true checkable:true onClicked: setMeshType(infillMeshType) z: 2 } - ToolBarButton + Cura.ToolbarButton { id: antiOverhangMeshButton text: catalog.i18nc("@label", "Don't support overlaps") - iconSource: UM.Theme.getIcon("BlockSupportOverlaps"); + toolItem: UM.RecolorImage + { + source: UM.Theme.getIcon("BlockSupportOverlaps") + color: UM.Theme.getColor("icon") + } property bool needBorder: true checkable: true onClicked: setMeshType(antiOverhangMeshType) diff --git a/plugins/PerObjectSettingsTool/ToolBarButton.qml b/plugins/PerObjectSettingsTool/ToolBarButton.qml deleted file mode 100644 index 0aa35c3a52..0000000000 --- a/plugins/PerObjectSettingsTool/ToolBarButton.qml +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright (c) 2022 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.1 -import QtQuick.Controls 2.1 - -import Cura 1.0 as Cura -import UM 1.5 as UM - -Button -{ - id: base - - property alias tooltip: tooltip.text - property alias iconSource: icon.source; - - Cura.ToolTip - { - id: tooltip - visible: base.hovered - targetPoint: Qt.point(parent.x, Math.round(parent.y + parent.height / 2)) - } - - - background: Item - { - implicitWidth: UM.Theme.getSize("button").width - implicitHeight: UM.Theme.getSize("button").height - - Rectangle - { - id: buttonFace - - anchors.fill: parent - property bool down: base.pressed || (base.checkable && base.checked) - - color: - { - if(base.customColor !== undefined && base.customColor !== null) - { - return base.customColor - } - else if(base.checkable && base.checked && base.hovered) - { - return UM.Theme.getColor("toolbar_button_active_hover") - } - else if(base.pressed || (base.checkable && base.checked)) - { - return UM.Theme.getColor("toolbar_button_active") - } - else if(base.hovered) - { - return UM.Theme.getColor("toolbar_button_hover") - } - return UM.Theme.getColor("toolbar_background") - } - Behavior on color { ColorAnimation { duration: 50 } } - - border.width: (base.hasOwnProperty("needBorder") && base.needBorder) ? UM.Theme.getSize("default_lining").width : 0 - border.color: base.checked ? UM.Theme.getColor("icon") : UM.Theme.getColor("lining") - } - } - - contentItem: Item - { - UM.RecolorImage - { - id: icon - - anchors.centerIn: parent - opacity: base.enabled ? 1.0 : 0.2 - width: UM.Theme.getSize("medium_button_icon").width - height: UM.Theme.getSize("medium_button_icon").height - color: UM.Theme.getColor("icon") - - sourceSize: UM.Theme.getSize("medium_button_icon") - } - } -} \ No newline at end of file From 200e4df0254a5a3f4907331da6ee82a3030ba575 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 26 Jan 2022 10:25:20 +0100 Subject: [PATCH 26/50] Fix issues in simulation view - Correctly display text in LayerType dropdown menu - Use UM.Label component to reduce code duplication - Don't display QtControls default dropdown icon CURA-8684 --- .../SimulationViewMenuComponent.qml | 55 +++++++++---------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index e40f7d0e4b..0a5065abf0 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -93,7 +93,8 @@ Cura.ExpandableComponent spacing: UM.Theme.getSize("layerview_row_spacing").height - ListModel // matches SimulationView.py + // matches SimulationView.py + ListModel { id: layerViewTypes } @@ -129,6 +130,8 @@ Cura.ExpandableComponent ComboBox { id: layerTypeCombobox + textRole: "text" + valueRole: "type_id" width: parent.width model: layerViewTypes visible: !UM.SimulationView.compatibilityMode @@ -146,39 +149,33 @@ Cura.ExpandableComponent radius: UM.Theme.getSize("setting_control_radius").width } - contentItem: Item + indicator: UM.RecolorImage { - Label - { - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_lining").width - anchors.right: downArrow.left - anchors.rightMargin: UM.Theme.getSize("default_lining").width - anchors.verticalCenter: parent.verticalCenter + id: downArrow + anchors.right: parent.right + anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 + anchors.verticalCenter: parent.verticalCenter - text: ladyerTypeCombobox.currentText - font: UM.Theme.getFont("default"); - color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") + source: UM.Theme.getIcon("ChevronSingleDown") + width: UM.Theme.getSize("standard_arrow").width + height: UM.Theme.getSize("standard_arrow").height + sourceSize.width: width + 5 * screenScaleFactor + sourceSize.height: width + 5 * screenScaleFactor - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } + color: UM.Theme.getColor("setting_control_button"); + } - UM.RecolorImage - { - id: downArrow - anchors.right: parent.right - anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 - anchors.verticalCenter: parent.verticalCenter + contentItem: UM.Label + { + anchors.left: parent.left + anchors.leftMargin: UM.Theme.getSize("default_lining").width + anchors.right: downArrow.left + anchors.rightMargin: UM.Theme.getSize("default_lining").width + anchors.verticalCenter: parent.verticalCenter - source: UM.Theme.getIcon("ChevronSingleDown") - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor - - color: UM.Theme.getColor("setting_control_button"); - } + text: layerTypeCombobox.currentText + elide: Text.ElideRight + verticalAlignment: Text.AlignVCenter } onActivated: From a74c7aa4f3c8aeef98a147a0892bbb144b8e64e2 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 26 Jan 2022 11:46:40 +0100 Subject: [PATCH 27/50] Remove unused contentItem CURA-8684 --- resources/qml/PrintSetupHeaderButton.qml | 2 -- 1 file changed, 2 deletions(-) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index c0beac3205..e6b5cc3d1d 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -13,8 +13,6 @@ ToolButton property alias tooltip: tooltip.text - contentItem: Label {} - Cura.ToolTip { id: tooltip From b3a6d8a1fc4b032a5816d51d030646ab46bc5766 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 26 Jan 2022 11:47:14 +0100 Subject: [PATCH 28/50] Use `UM.Label` in print setup header button CURA-8684 --- resources/qml/PrintSetupHeaderButton.qml | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index e6b5cc3d1d..8dc99ea38f 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -85,18 +85,16 @@ ToolButton color: base.enabled ? UM.Theme.getColor("setting_control_button") : UM.Theme.getColor("setting_category_disabled_text") source: UM.Theme.getIcon("ChevronSingleDown") } - Label + UM.Label { id: printSetupComboBoxLabel - color: base.enabled ? UM.Theme.getColor("setting_control_text") : UM.Theme.getColor("setting_control_disabled_text") - text: base.text; + text: base.text elide: Text.ElideRight; anchors.left: parent.left; anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width - anchors.right: downArrow.left; - anchors.rightMargin: base.rightMargin; - anchors.verticalCenter: parent.verticalCenter; - font: UM.Theme.getFont("default") + anchors.right: downArrow.lef + anchors.rightMargin: base.rightMargin + anchors.verticalCenter: parent.verticalCenter } } } From a66275ce73c0e0e1f8caf37c3c4f3d2a266dfe34 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 26 Jan 2022 12:01:30 +0100 Subject: [PATCH 29/50] Fix PrintSetupHeaderButton displaying text twice CURA-8684 --- resources/qml/PrintSetupHeaderButton.qml | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index 8dc99ea38f..8a4b50ea15 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -85,16 +85,17 @@ ToolButton color: base.enabled ? UM.Theme.getColor("setting_control_button") : UM.Theme.getColor("setting_category_disabled_text") source: UM.Theme.getIcon("ChevronSingleDown") } - UM.Label - { - id: printSetupComboBoxLabel - text: base.text - elide: Text.ElideRight; - anchors.left: parent.left; - anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width - anchors.right: downArrow.lef - anchors.rightMargin: base.rightMargin - anchors.verticalCenter: parent.verticalCenter - } + } + + contentItem: UM.Label + { + id: printSetupComboBoxLabel + text: base.text + elide: Text.ElideRight; + anchors.left: parent.left; + anchors.leftMargin: UM.Theme.getSize("setting_unit_margin").width + anchors.right: downArrow.lef + anchors.rightMargin: base.rightMargin + anchors.verticalCenter: parent.verticalCenter } } From a2d03af2f147bf0c073472fe694d6d14f7ea98a1 Mon Sep 17 00:00:00 2001 From: casper Date: Wed, 26 Jan 2022 12:15:13 +0100 Subject: [PATCH 30/50] Use states to set border&background color in print setup header button CURA-8684 --- resources/qml/PrintSetupHeaderButton.qml | 103 +++++++++++++---------- 1 file changed, 59 insertions(+), 44 deletions(-) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index 8a4b50ea15..540f16a284 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -20,59 +20,74 @@ ToolButton targetPoint: Qt.point(parent.x, Math.round(parent.y + parent.height / 2)) } - background: Rectangle - { - color: + states: + [ + State { - if(base.enabled) + name: "disabled" + when: !base.enabled; + PropertyChanges { - if(base.valueError) - { - return UM.Theme.getColor("setting_validation_error_background"); - } - else if(base.valueWarning) - { - return UM.Theme.getColor("setting_validation_warning_background"); - } - else - { - return UM.Theme.getColor("setting_control"); - } + target: background + color: UM.Theme.getColor("setting_control_disabled") + border.color: UM.Theme.getColor("setting_control_disabled_border") } - else + }, + State + { + name: "value_error" + when: base.enabled && base.valueError + PropertyChanges { - return UM.Theme.getColor("setting_control_disabled"); + target: background + color: UM.Theme.getColor("setting_validation_error_background") + border.color: UM.Theme.getColor("setting_validation_error") + } + }, + State + { + name: "value_warning" + when: base.enabled && base.valueWarning + PropertyChanges + { + target: background + color: UM.Theme.getColor("setting_validation_warning_background") + border.color: UM.Theme.getColor("setting_validation_warning") + } + }, + State + { + name: "highlight" + when: base.enabled && base.hovered + PropertyChanges + { + target: background + color: UM.Theme.getColor("setting_control") + border.color: UM.Theme.getColor("setting_control_border_highlight") + } + }, + State + { + name: "neutral" + when: base.enabled && !base.hovered && !base.valueWarning && !base.valueError + PropertyChanges + { + target: background + color: UM.Theme.getColor("setting_control") + border.color: UM.Theme.getColor("setting_control_border") } } + ] + + background: Rectangle + { + id: background radius: UM.Theme.getSize("setting_control_radius").width border.width: UM.Theme.getSize("default_lining").width - border.color: - { - if (base.enabled) - { - if (base.valueError) - { - return UM.Theme.getColor("setting_validation_error"); - } - else if (base.valueWarning) - { - return UM.Theme.getColor("setting_validation_warning"); - } - else if (base.hovered) - { - return UM.Theme.getColor("setting_control_border_highlight"); - } - else - { - return UM.Theme.getColor("setting_control_border"); - } - } - else - { - return UM.Theme.getColor("setting_control_disabled_border"); - } - } + color: UM.Theme.getColor("setting_control") + border.color: UM.Theme.getColor("setting_control_border") + UM.RecolorImage { id: downArrow From 69de60eb1452ea04549e2d485a2d09dcc564bb00 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Thu, 27 Jan 2022 16:03:58 +0100 Subject: [PATCH 31/50] Update resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml Co-authored-by: Ghostkeeper --- resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml index 08d10bbfff..b739ad0436 100644 --- a/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml +++ b/resources/qml/Dialogs/OpenFilesIncludingProjectsDialog.qml @@ -74,7 +74,8 @@ UM.Dialog name: "cura" } - ButtonGroup { + ButtonGroup + { buttons: [cancelButton, importAllAsModelsButton] checkedButton: importAllAsModelsButton } From a5e2e290558782f8750b5edf0f4063a05a58e965 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Thu, 27 Jan 2022 16:04:10 +0100 Subject: [PATCH 32/50] Update resources/qml/Preferences/GeneralPage.qml Co-authored-by: Ghostkeeper --- resources/qml/Preferences/GeneralPage.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index f7c19cd27d..9c002b1d80 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -842,7 +842,8 @@ UM.PreferencesPage } } - ButtonGroup { + ButtonGroup + { id: curaUpdatesGroup buttons: [checkUpdatesOptionBeta, checkUpdatesOptionStable] } From 7f17ef6c51431a8e28fa6ac2ef1bdb99be3147b5 Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Thu, 27 Jan 2022 16:04:17 +0100 Subject: [PATCH 33/50] Update resources/qml/PrintSetupHeaderButton.qml Co-authored-by: Ghostkeeper --- resources/qml/PrintSetupHeaderButton.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index 540f16a284..819d893e16 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.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.1 From 4ef394fa2df94c652cb14c2886f4138750e5642a Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 28 Jan 2022 09:47:01 +0100 Subject: [PATCH 34/50] Update manual printer control to QtControls 2 CURA-8684 --- resources/qml/PrinterOutput/ManualPrinterControl.qml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/resources/qml/PrinterOutput/ManualPrinterControl.qml b/resources/qml/PrinterOutput/ManualPrinterControl.qml index fa7e3024dd..33717ad76c 100644 --- a/resources/qml/PrinterOutput/ManualPrinterControl.qml +++ b/resources/qml/PrinterOutput/ManualPrinterControl.qml @@ -1,9 +1,8 @@ -// 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 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 import UM 1.5 as UM @@ -258,7 +257,7 @@ Item width: height + UM.Theme.getSize("default_margin").width text: model.label - exclusiveGroup: distanceGroup + ButtonGroup.group: distanceGroup checkable: true checked: distancesRow.currentDistance == model.value onClicked: distancesRow.currentDistance = model.value @@ -390,6 +389,6 @@ Item ListElement { label: "10"; value: 10 } ListElement { label: "100"; value: 100 } } - ExclusiveGroup { id: distanceGroup } + ButtonGroup { id: distanceGroup } } } From 2290b46bf3acc75a9346815e0d61e0d5aef94751 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 28 Jan 2022 09:47:44 +0100 Subject: [PATCH 35/50] Use the Cura Combobox Component in simulation view CURA-8684 --- .../SimulationViewMenuComponent.qml | 49 +------------------ 1 file changed, 2 insertions(+), 47 deletions(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 0a5065abf0..ba2c62153f 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -127,7 +127,7 @@ Cura.ExpandableComponent }) } - ComboBox + Cura.ComboBox { id: layerTypeCombobox textRole: "text" @@ -136,52 +136,7 @@ Cura.ExpandableComponent model: layerViewTypes visible: !UM.SimulationView.compatibilityMode - background: Rectangle - { - implicitHeight: UM.Theme.getSize("setting_control").height; - implicitWidth: UM.Theme.getSize("setting_control").width; - - color: ladyerTypeCombobox.hovered ? UM.Theme.getColor("setting_control_highlight") : UM.Theme.getColor("setting_control") - Behavior on color { ColorAnimation { duration: 50; } } - - border.width: UM.Theme.getSize("default_lining").width; - border.color: ladyerTypeCombobox.hovered ? UM.Theme.getColor("setting_control_border_highlight") : UM.Theme.getColor("setting_control_border"); - radius: UM.Theme.getSize("setting_control_radius").width - } - - indicator: UM.RecolorImage - { - id: downArrow - anchors.right: parent.right - anchors.rightMargin: UM.Theme.getSize("default_lining").width * 2 - anchors.verticalCenter: parent.verticalCenter - - source: UM.Theme.getIcon("ChevronSingleDown") - width: UM.Theme.getSize("standard_arrow").width - height: UM.Theme.getSize("standard_arrow").height - sourceSize.width: width + 5 * screenScaleFactor - sourceSize.height: width + 5 * screenScaleFactor - - color: UM.Theme.getColor("setting_control_button"); - } - - contentItem: UM.Label - { - anchors.left: parent.left - anchors.leftMargin: UM.Theme.getSize("default_lining").width - anchors.right: downArrow.left - anchors.rightMargin: UM.Theme.getSize("default_lining").width - anchors.verticalCenter: parent.verticalCenter - - text: layerTypeCombobox.currentText - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - - onActivated: - { - UM.Preferences.setValue("layerview/layer_view_type", index); - } + onActivated: UM.Preferences.setValue("layerview/layer_view_type", index) Component.onCompleted: { From 29fc98fea4e2b3d2320aeb6cee1fb0f77f4da650 Mon Sep 17 00:00:00 2001 From: casper Date: Fri, 28 Jan 2022 10:33:01 +0100 Subject: [PATCH 36/50] Add documentation to PrintSetupHeaderButton CURA-8684 --- .../Menus/ConfigurationMenu/CustomConfiguration.qml | 13 +++++-------- resources/qml/PrintSetupHeaderButton.qml | 2 ++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index 95026112ba..cf130487dd 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -7,6 +7,9 @@ import QtQuick.Controls 2.0 import Cura 1.0 as Cura import UM 1.5 as UM +// Simple button for displaying text and changes appearance for various states: enabled, valueError, valueWarning +// - and hovered. Mainly used in CustomConfiguration.qml + Item { UM.I18nCatalog @@ -283,10 +286,7 @@ Item extruderIndex: Cura.ExtruderManager.activeExtruderIndex updateModels: materialSelection.visible } - onClicked: - { - materialsMenu.popup(); - } + onClicked: materialsMenu.popup() } Item { @@ -338,10 +338,7 @@ Item id: nozzlesMenu extruderIndex: Cura.ExtruderManager.activeExtruderIndex } - onClicked: - { - nozzlesMenu.popup(); - } + onClicked: nozzlesMenu.popup() } } diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index 819d893e16..a67c48d79f 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -1,6 +1,8 @@ // Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. +// Button component to be used within the + import QtQuick 2.1 import QtQuick.Controls 2.1 From f62a5e7340ab4cc4a8c4804c8dbb2dda400fb235 Mon Sep 17 00:00:00 2001 From: casper Date: Sun, 30 Jan 2022 23:19:11 +0100 Subject: [PATCH 37/50] Allow decimal point for values input in materials view CURA-8684 --- resources/qml/Preferences/Materials/MaterialsView.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index aca8af0cda..fc706beec3 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -270,7 +270,7 @@ OldControls.TabView valueFromText: function(text) { // remove all non-number tokens from input string so value can be parsed correctly - var value = Number(text.replace(/[^0-9.-]+/g, "")); + var value = Number(text.replace(",", ".").replace(/[^0-9.-]+/g, "")); var precision = Math.pow(10, spoolCostSpinBox.decimals); return Math.round(value * precision) / precision; } @@ -298,7 +298,7 @@ OldControls.TabView valueFromText: function(text, locale) { // remove all non-number tokens from input string so value can be parsed correctly - var value = Number(text.replace(/[^0-9.-]+/g, "")); + var value = Number(text.replace(",", ".").replace(/[^0-9.-]+/g, "")); return Math.round(value); } From ac080f3cd7fa16b3ab084266280404709d1691de Mon Sep 17 00:00:00 2001 From: casper Date: Sun, 30 Jan 2022 23:22:58 +0100 Subject: [PATCH 38/50] Provide height in the line type combobox of the simulation view CURA-8684 --- plugins/SimulationView/SimulationViewMenuComponent.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index ba2c62153f..74d539ba1d 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -133,6 +133,7 @@ Cura.ExpandableComponent textRole: "text" valueRole: "type_id" width: parent.width + implicitHeight: UM.Theme.getSize("setting_control").height; model: layerViewTypes visible: !UM.SimulationView.compatibilityMode From 89796324579b3e1b770cbb58bdd86344f5fec50b Mon Sep 17 00:00:00 2001 From: casper Date: Sun, 30 Jan 2022 23:30:39 +0100 Subject: [PATCH 39/50] Resolve Qt warning CURA-8684 --- resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml index cf130487dd..b25bb5f5eb 100644 --- a/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml +++ b/resources/qml/Menus/ConfigurationMenu/CustomConfiguration.qml @@ -278,7 +278,7 @@ Item width: selectors.controlWidth height: parent.height - focusPolicy: ClickFocus + focusPolicy: Qt.ClickFocus Cura.MaterialMenu { @@ -330,7 +330,7 @@ Item tooltip: text height: parent.height width: selectors.controlWidth - focusPolicy: ClickFocus + focusPolicy: Qt.ClickFocus enabled: enabledCheckbox.checked Cura.NozzleMenu From f94813a98e26b2825ccdc299743f764713c9d5c1 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 31 Jan 2022 08:59:23 +0100 Subject: [PATCH 40/50] Fix description CURA-8684 --- resources/qml/PrintSetupHeaderButton.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index a67c48d79f..2a595aa06f 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -1,7 +1,8 @@ // Copyright (c) 2022 Ultimaker B.V. // Cura is released under the terms of the LGPLv3 or higher. -// Button component to be used within the +// Button with a label-like appearance that displays different states (these can be displayed by setting the +// `valueError` or `valueWarning` properties). Mainly used within the `CustomConfiguration` component. import QtQuick 2.1 import QtQuick.Controls 2.1 From 5aa67770a2cfd9bcac21bb1172b13bd5ff860b6a Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 31 Jan 2022 09:00:30 +0100 Subject: [PATCH 41/50] Add properties (with defaults) to the PrintSetupHeaderButton state-props Resolves 2 QML-warnings CURA-8684 --- resources/qml/PrintSetupHeaderButton.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/qml/PrintSetupHeaderButton.qml b/resources/qml/PrintSetupHeaderButton.qml index 2a595aa06f..2583c6b84e 100644 --- a/resources/qml/PrintSetupHeaderButton.qml +++ b/resources/qml/PrintSetupHeaderButton.qml @@ -16,6 +16,9 @@ ToolButton property alias tooltip: tooltip.text + property bool valueError: false; + property bool valueWarning: false; + Cura.ToolTip { id: tooltip From 264ce3bdd16832f8d84e206fbd2b650c5c3d5439 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 31 Jan 2022 10:28:00 +0100 Subject: [PATCH 42/50] Make texts fields selectable by mouse for various components This enables mouse-selectable for - The image reader dialog - Layer view text field (in simulation view) - The TextField with unit component (for instace used to set the scale of models) - Rename dialog(s) - Currency text field - The settings filter text field CURA-8684 --- plugins/ImageReader/ConfigUI.qml | 5 +++++ plugins/PerObjectSettingsTool/SettingPickDialog.qml | 1 + plugins/SimulationView/SimulationSliderLabel.qml | 4 +++- resources/qml/Preferences/GeneralPage.qml | 1 + 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index 1195f0c046..2de1de224c 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -42,6 +42,7 @@ UM.Dialog TextField { id: peak_height + selectByMouse: true objectName: "Peak_Height" validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/} width: 180 * screenScaleFactor @@ -65,6 +66,7 @@ UM.Dialog TextField { id: base_height + selectByMouse: true objectName: "Base_Height" validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/} width: 180 * screenScaleFactor @@ -88,6 +90,7 @@ UM.Dialog TextField { id: width + selectByMouse: true objectName: "Width" focus: true validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} @@ -111,6 +114,7 @@ UM.Dialog } TextField { id: depth + selectByMouse: true objectName: "Depth" focus: true validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} @@ -180,6 +184,7 @@ UM.Dialog } TextField { id: transmittance + selectByMouse: true objectName: "Transmittance" focus: true validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index 0e9202a900..6d5a4be099 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -46,6 +46,7 @@ UM.Dialog TextField { id: filterInput + selectByMouse: true anchors { diff --git a/plugins/SimulationView/SimulationSliderLabel.qml b/plugins/SimulationView/SimulationSliderLabel.qml index 850fff7440..1c434ae935 100644 --- a/plugins/SimulationView/SimulationSliderLabel.qml +++ b/plugins/SimulationView/SimulationSliderLabel.qml @@ -1,5 +1,6 @@ -// 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.5 import QtQuick.Controls 2.2 import QtQuick.Layouts 1.1 @@ -62,6 +63,7 @@ UM.PointingRectangle font: UM.Theme.getFont("default") renderType: Text.NativeRendering background: Item {} + selectByMouse: true onEditingFinished: { diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 9c002b1d80..c916f096e6 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -216,6 +216,7 @@ UM.PreferencesPage TextField { id: currencyField + selectByMouse: true text: UM.Preferences.getValue("cura/currency") onTextChanged: UM.Preferences.setValue("cura/currency", text) } From 1ecc1ad7535b631c8b159cb0a356ebb819463223 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 31 Jan 2022 13:43:08 +0100 Subject: [PATCH 43/50] Update styling in image loader plugin CURA-8684 --- plugins/ImageReader/ConfigUI.qml | 412 +++++++++++++++++-------------- 1 file changed, 232 insertions(+), 180 deletions(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index 2de1de224c..16b0827ae8 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -2,227 +2,279 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -import QtQuick.Controls 2.0 -import QtQuick.Layouts 1.1 +import QtQuick.Controls 2.3 +import QtQuick.Layouts 1.3 import QtQuick.Window 2.1 -import UM 1.1 as UM +import UM 1.5 as UM +import Cura 1.0 as Cura UM.Dialog { - width: minimumWidth; - minimumWidth: 350 * screenScaleFactor; - - height: minimumHeight; - minimumHeight: 250 * screenScaleFactor; - title: catalog.i18nc("@title:window", "Convert Image...") + minimumWidth: grid.width + 2 * UM.Theme.getSize("default_margin").height + minimumHeight: UM.Theme.getSize("modal_window_minimum").height + width: minimumWidth + height: minimumHeight + GridLayout { - UM.I18nCatalog{id: catalog; name: "cura"} - anchors.fill: parent; - Layout.fillWidth: true - columnSpacing: 16 * screenScaleFactor - rowSpacing: 4 * screenScaleFactor - columns: 1 + UM.I18nCatalog { id: catalog; name: "cura" } + id: grid + columnSpacing: UM.Theme.getSize("default_margin").width + rowSpacing: UM.Theme.getSize("thin_margin").height + columns: 2 - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","The maximum distance of each pixel from \"Base.\"") - Row { - width: parent.width + Label + { + Layout.fillWidth: true + text: catalog.i18nc("@action:label", "Height (mm)") + Layout.alignment: Qt.AlignVCenter - Label { - text: catalog.i18nc("@action:label", "Height (mm)") - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } - - TextField { - id: peak_height - selectByMouse: true - objectName: "Peak_Height" - validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/} - width: 180 * screenScaleFactor - onTextChanged: { manager.onPeakHeightChanged(text) } - } + MouseArea { + id: peak_height_label + anchors.fill: parent + hoverEnabled: true } } - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","The base height from the build plate in millimeters.") - Row { - width: parent.width + TextField + { + id: peak_height + Layout.fillWidth: true + selectByMouse: true + objectName: "Peak_Height" +// validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } + onTextChanged: manager.onPeakHeightChanged(text) + } - Label { - text: catalog.i18nc("@action:label", "Base (mm)") - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "The maximum distance of each pixel from \"Base.\"") + visible: peak_height.hovered || peak_height_label.containsMouse + targetPoint: Qt.point(peak_height.x + Math.round(peak_height.width / 2), 0) + y: peak_height.y + peak_height.height + UM.Theme.getSize("default_margin").height + } - TextField { - id: base_height - selectByMouse: true - objectName: "Base_Height" - validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/} - width: 180 * screenScaleFactor - onTextChanged: { manager.onBaseHeightChanged(text) } - } + Label + { + Layout.fillWidth: true + text: catalog.i18nc("@action:label", "Base (mm)") + Layout.alignment: Qt.AlignVCenter + + MouseArea { + id: base_height_label + anchors.fill: parent + hoverEnabled: true } } - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","The width in millimeters on the build plate.") - Row { - width: parent.width + TextField + { + id: base_height + selectByMouse: true + Layout.fillWidth: true + objectName: "Base_Height" +// validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } + onTextChanged: manager.onBaseHeightChanged(text) + } - Label { - text: catalog.i18nc("@action:label", "Width (mm)") - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "The base height from the build plate in millimeters.") + visible: base_height.hovered || base_height_label.containsMouse + targetPoint: Qt.point(base_height.x + Math.round(base_height.width / 2), 0) + y: base_height.y + base_height.height + UM.Theme.getSize("default_margin").height + } - TextField { - id: width - selectByMouse: true - objectName: "Width" - focus: true - validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} - width: 180 * screenScaleFactor - onTextChanged: { manager.onWidthChanged(text) } - } + Label + { + Layout.fillWidth: true + text: catalog.i18nc("@action:label", "Width (mm)") + Layout.alignment: Qt.AlignVCenter + + MouseArea { + id: width_label + anchors.fill: parent + hoverEnabled: true } } - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","The depth in millimeters on the build plate") - Row { - width: parent.width + TextField + { + id: width + selectByMouse: true + objectName: "Width" + Layout.fillWidth: true + focus: true +// validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } + onTextChanged: manager.onWidthChanged(text) + } - Label { - text: catalog.i18nc("@action:label", "Depth (mm)") - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } - TextField { - id: depth - selectByMouse: true - objectName: "Depth" - focus: true - validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} - width: 180 * screenScaleFactor - onTextChanged: { manager.onDepthChanged(text) } - } + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "The width in millimeters on the build plate") + visible: width.hovered || width_label.containsMouse + targetPoint: Qt.point(width.x + Math.round(width.width / 2), 0) + y: width.y + width.height + UM.Theme.getSize("default_margin").height + } + + Label + { + Layout.fillWidth: true + text: catalog.i18nc("@action:label", "Depth (mm)") + Layout.alignment: Qt.AlignVCenter + + MouseArea { + id: depth_label + anchors.fill: parent + hoverEnabled: true } } - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","For lithophanes dark pixels should correspond to thicker locations in order to block more light coming through. For height maps lighter pixels signify higher terrain, so lighter pixels should correspond to thicker locations in the generated 3D model.") - Row { - width: parent.width + TextField + { + id: depth + Layout.fillWidth: true + selectByMouse: true + objectName: "Depth" + focus: true +// validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } + onTextChanged: manager.onDepthChanged(text) + } - //Empty label so 2 column layout works. - Label { - text: "" - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } - ComboBox { - id: lighter_is_higher - objectName: "Lighter_Is_Higher" - model: [ catalog.i18nc("@item:inlistbox","Darker is higher"), catalog.i18nc("@item:inlistbox","Lighter is higher") ] - width: 180 * screenScaleFactor - onCurrentIndexChanged: { manager.onImageColorInvertChanged(currentIndex) } - } + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "The depth in millimeters on the build plate") + visible: depth.hovered || depth_label.containsMouse + targetPoint: Qt.point(depth.x + Math.round(depth.width / 2), 0) + y: depth.y + depth.height + UM.Theme.getSize("default_margin").height + } + + Label + { + Layout.fillWidth: true + text: "" + Layout.alignment: Qt.AlignVCenter + + MouseArea { + id: lighter_is_higher_label + anchors.fill: parent + hoverEnabled: true } } - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","For lithophanes a simple logarithmic model for translucency is available. For height maps the pixel values correspond to heights linearly.") - Row { - width: parent.width + ComboBox + { + id: lighter_is_higher + Layout.fillWidth: true + Layout.preferredHeight: UM.Theme.getSize("toolbox_action_button").height + objectName: "Lighter_Is_Higher" + model: [catalog.i18nc("@item:inlistbox", "Darker is higher"), catalog.i18nc("@item:inlistbox", "Lighter is higher")] + onCurrentIndexChanged: { manager.onImageColorInvertChanged(currentIndex) } + } - Label { - text: "Color Model" - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } - ComboBox { - id: color_model - objectName: "ColorModel" - model: [ catalog.i18nc("@item:inlistbox","Linear"), catalog.i18nc("@item:inlistbox","Translucency") ] - width: 180 * screenScaleFactor - onCurrentIndexChanged: { manager.onColorModelChanged(currentIndex) } - } + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "For lithophanes dark pixels should correspond to thicker locations in order to block more light coming through. For height maps lighter pixels signify higher terrain, so lighter pixels should correspond to thicker locations in the generated 3D model.") + visible: lighter_is_higher.hovered || lighter_is_higher_label.containsMouse + targetPoint: Qt.point(lighter_is_higher.x + Math.round(lighter_is_higher.width / 2), 0) + y: lighter_is_higher.y + lighter_is_higher.height + UM.Theme.getSize("default_margin").height + } + + Label + { + Layout.fillWidth: true + text: catalog.i18nc("@action:label", "Color Model") + Layout.alignment: Qt.AlignVCenter + + MouseArea { + id: color_model_label + anchors.fill: parent + hoverEnabled: true } } - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.") - visible: color_model.currentText == catalog.i18nc("@item:inlistbox","Translucency") - Row { - width: parent.width + ComboBox + { + id: color_model + Layout.fillWidth: true + objectName: "ColorModel" + model: [catalog.i18nc("@item:inlistbox", "Linear"), catalog.i18nc("@item:inlistbox", "Translucency")] + onCurrentIndexChanged: { manager.onColorModelChanged(currentIndex) } + Layout.preferredHeight: UM.Theme.getSize("toolbox_action_button").height + } - Label { - text: catalog.i18nc("@action:label", "1mm Transmittance (%)") - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } - TextField { - id: transmittance - selectByMouse: true - objectName: "Transmittance" - focus: true - validator: RegExpValidator {regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/} - width: 180 * screenScaleFactor - onTextChanged: { manager.onTransmittanceChanged(text) } - } + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "For lithophanes a simple logarithmic model for translucency is available. For height maps the pixel values correspond to heights linearly.") + visible: color_model.hovered || color_model_label.containsMouse + targetPoint: Qt.point(color_model.x + Math.round(color_model.width / 2), 0) + y: color_model.y + color_model.height + UM.Theme.getSize("default_margin").height + } + + Label + { + Layout.fillWidth: true + text: catalog.i18nc("@action:label", "1mm Transmittance (%)") + Layout.alignment: Qt.AlignVCenter + + MouseArea { + id: transmittance_label + anchors.fill: parent + hoverEnabled: true } } - UM.TooltipArea { - Layout.fillWidth:true - height: childrenRect.height - text: catalog.i18nc("@info:tooltip","The amount of smoothing to apply to the image.") - Row { - width: parent.width + TextField + { + id: transmittance + Layout.fillWidth: true + selectByMouse: true + objectName: "Transmittance" +// validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } + onTextChanged: manager.onTransmittanceChanged(text) + } - Label { - text: catalog.i18nc("@action:label", "Smoothing") - width: 150 * screenScaleFactor - anchors.verticalCenter: parent.verticalCenter - } + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.") + visible: transmittance.hovered || transmittance_label.containsMouse + targetPoint: Qt.point(transmittance.x + Math.round(transmittance.width / 2), 0) + y: transmittance.y + transmittance.height + UM.Theme.getSize("default_margin").height + } - Item { - width: 180 * screenScaleFactor - height: 20 * screenScaleFactor - Layout.fillWidth: true + Label + { + Layout.fillWidth: true + text: catalog.i18nc("@action:label", "Smoothing") + Layout.alignment: Qt.AlignVCenter - Slider { - id: smoothing - objectName: "Smoothing" - to: 100.0 - stepSize: 1.0 - width: 180 - onValueChanged: { manager.onSmoothingChanged(value) } - } - } + MouseArea { + id: smoothing_label + anchors.fill: parent + hoverEnabled: true } } + + Slider + { + id: smoothing + Layout.fillWidth: true + objectName: "Smoothing" + to: 100.0 + stepSize: 1.0 + onValueChanged: { manager.onSmoothingChanged(value) } + } + + Cura.ToolTip + { + text: catalog.i18nc("@info:tooltip", "The amount of smoothing to apply to the image.") + visible: smoothing.hovered || smoothing_label.containsMouse + targetPoint: Qt.point(smoothing.x + Math.round(smoothing.width / 2), 0) + y: smoothing.y + smoothing.height + UM.Theme.getSize("default_margin").height + } } Item @@ -240,14 +292,14 @@ UM.Dialog rightButtons: [ Button { - id:ok_button - text: catalog.i18nc("@action:button","OK"); + id: ok_button + text: catalog.i18nc("@action:button", "OK") onClicked: manager.onOkButtonClicked() }, Button { - id:cancel_button - text: catalog.i18nc("@action:button","Cancel"); + id: cancel_button + text: catalog.i18nc("@action:button", "Cancel") onClicked: manager.onCancelButtonClicked() } ] From 14767a92c69c8b9fda3aa6727b29c129d87fc239 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 31 Jan 2022 14:35:21 +0100 Subject: [PATCH 44/50] Allow mouse selection in SpinBox CURA-8684 --- .../qml/Preferences/Materials/MaterialsView.qml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index fc706beec3..b19814a1a0 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -266,6 +266,13 @@ OldControls.TabView to: 100000000 editable: true + contentItem: TextField + { + text: spoolCostSpinBox.textFromValue(spoolCostSpinBox.value, spoolCostSpinBox.locale) + selectByMouse: true + background: Item {} + } + property int decimals: 2 valueFromText: function(text) { @@ -296,6 +303,13 @@ OldControls.TabView to: 10000 editable: true + contentItem: TextField + { + text: spoolWeightSpinBox.textFromValue(spoolWeightSpinBox.value, spoolWeightSpinBox.locale) + selectByMouse: true + background: Item {} + } + valueFromText: function(text, locale) { // remove all non-number tokens from input string so value can be parsed correctly var value = Number(text.replace(",", ".").replace(/[^0-9.-]+/g, "")); From b2af6308e565bcef875816b3152621d9789f52c1 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 31 Jan 2022 15:18:58 +0100 Subject: [PATCH 45/50] Add validator to material cost/weight spinboxes This way only valid numbers can be entered CURA-8684 --- resources/qml/Preferences/Materials/MaterialsView.qml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index b19814a1a0..ab152a0fe3 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -271,13 +271,14 @@ OldControls.TabView text: spoolCostSpinBox.textFromValue(spoolCostSpinBox.value, spoolCostSpinBox.locale) selectByMouse: true background: Item {} + validator: RegExpValidator { regExp: new RegExp("^" + base.currency + " ([0-9]+[.]?[0-9]*)?$") } } property int decimals: 2 valueFromText: function(text) { // remove all non-number tokens from input string so value can be parsed correctly - var value = Number(text.replace(",", ".").replace(/[^0-9.-]+/g, "")); + var value = Number(text.replace(",", ".").replace(/[^0-9.]+/g, "")); var precision = Math.pow(10, spoolCostSpinBox.decimals); return Math.round(value * precision) / precision; } @@ -308,11 +309,12 @@ OldControls.TabView text: spoolWeightSpinBox.textFromValue(spoolWeightSpinBox.value, spoolWeightSpinBox.locale) selectByMouse: true background: Item {} + validator: RegExpValidator { regExp: new RegExp("^([0-9]+[.]?[0-9]*)? g$") } } valueFromText: function(text, locale) { // remove all non-number tokens from input string so value can be parsed correctly - var value = Number(text.replace(",", ".").replace(/[^0-9.-]+/g, "")); + var value = Number(text.replace(",", ".").replace(/[^0-9.]+/g, "")); return Math.round(value); } From 4cb4e0e38c9c8a5b2221f4d99a63f4b559fcd185 Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 31 Jan 2022 15:47:42 +0100 Subject: [PATCH 46/50] Re-enable validators in ImageLoaderPlugin CURA-8684 --- plugins/ImageReader/ConfigUI.qml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index 16b0827ae8..0d05135b08 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -45,7 +45,7 @@ UM.Dialog Layout.fillWidth: true selectByMouse: true objectName: "Peak_Height" -// validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } + validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } onTextChanged: manager.onPeakHeightChanged(text) } @@ -76,7 +76,7 @@ UM.Dialog selectByMouse: true Layout.fillWidth: true objectName: "Base_Height" -// validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } + validator: RegExpValidator { regExp: /^\d{0,3}([\,|\.]\d*)?$/ } onTextChanged: manager.onBaseHeightChanged(text) } @@ -108,7 +108,7 @@ UM.Dialog objectName: "Width" Layout.fillWidth: true focus: true -// validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } + validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } onTextChanged: manager.onWidthChanged(text) } @@ -140,7 +140,7 @@ UM.Dialog selectByMouse: true objectName: "Depth" focus: true -// validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } + validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } onTextChanged: manager.onDepthChanged(text) } @@ -233,7 +233,7 @@ UM.Dialog Layout.fillWidth: true selectByMouse: true objectName: "Transmittance" -// validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } + validator: RegExpValidator { regExp: /^[1-9]\d{0,2}([\,|\.]\d*)?$/ } onTextChanged: manager.onTransmittanceChanged(text) } From 6ef28db4585f1d832847b489785d6eb8c664135e Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 31 Jan 2022 17:06:59 +0100 Subject: [PATCH 47/50] Remove unneeded semicolon CURA-8684 --- plugins/SimulationView/SimulationViewMenuComponent.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/SimulationView/SimulationViewMenuComponent.qml b/plugins/SimulationView/SimulationViewMenuComponent.qml index 74d539ba1d..ba13a75ea7 100644 --- a/plugins/SimulationView/SimulationViewMenuComponent.qml +++ b/plugins/SimulationView/SimulationViewMenuComponent.qml @@ -133,7 +133,7 @@ Cura.ExpandableComponent textRole: "text" valueRole: "type_id" width: parent.width - implicitHeight: UM.Theme.getSize("setting_control").height; + implicitHeight: UM.Theme.getSize("setting_control").height model: layerViewTypes visible: !UM.SimulationView.compatibilityMode From ee81326d6a25765c6e0707e1cf7a9ef550194185 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 31 Jan 2022 17:08:56 +0100 Subject: [PATCH 48/50] Fix remaining merge conflicts - When both branches added Controls1 as OldControls, it's not marked as a merge conflict. But the merge removed the need for OldControls, so the import can be removed. - There was one instance where I had removed the OldControls for a checkbox but there it should remain since the checkboxes are updated in a separate ticket. Contributes to issue CURA-8684. --- .../DigitalLibrary/resources/qml/CreateNewProjectPopup.qml | 4 ++-- .../resources/qml/DigitalFactoryOpenDialog.qml | 4 ++-- .../resources/qml/DigitalFactorySaveDialog.qml | 4 ++-- plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml | 5 ++--- plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml | 1 - resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml | 1 - resources/qml/Preferences/Materials/MaterialsView.qml | 2 -- resources/qml/Preferences/ProfilesPage.qml | 1 - resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml | 1 - .../Recommended/RecommendedSupportSelector.qml | 1 - resources/qml/ProfileOverview.qml | 1 - 11 files changed, 8 insertions(+), 17 deletions(-) diff --git a/plugins/DigitalLibrary/resources/qml/CreateNewProjectPopup.qml b/plugins/DigitalLibrary/resources/qml/CreateNewProjectPopup.qml index ee40c55356..74bc52b69e 100644 --- a/plugins/DigitalLibrary/resources/qml/CreateNewProjectPopup.qml +++ b/plugins/DigitalLibrary/resources/qml/CreateNewProjectPopup.qml @@ -1,8 +1,8 @@ -// 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 import QtQuick.Window 2.2 -import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 import UM 1.2 as UM diff --git a/plugins/DigitalLibrary/resources/qml/DigitalFactoryOpenDialog.qml b/plugins/DigitalLibrary/resources/qml/DigitalFactoryOpenDialog.qml index 435e8d3f86..11c5d687e8 100644 --- a/plugins/DigitalLibrary/resources/qml/DigitalFactoryOpenDialog.qml +++ b/plugins/DigitalLibrary/resources/qml/DigitalFactoryOpenDialog.qml @@ -1,8 +1,8 @@ -// 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 import QtQuick.Window 2.2 -import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 import UM 1.2 as UM diff --git a/plugins/DigitalLibrary/resources/qml/DigitalFactorySaveDialog.qml b/plugins/DigitalLibrary/resources/qml/DigitalFactorySaveDialog.qml index 5271db3174..56109dbcbe 100644 --- a/plugins/DigitalLibrary/resources/qml/DigitalFactorySaveDialog.qml +++ b/plugins/DigitalLibrary/resources/qml/DigitalFactorySaveDialog.qml @@ -1,8 +1,8 @@ -// 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 import QtQuick.Window 2.2 -import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 import UM 1.2 as UM diff --git a/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml b/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml index 25f25e2bbe..1e4b97fb33 100644 --- a/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml +++ b/plugins/DigitalLibrary/resources/qml/SelectProjectPage.qml @@ -1,9 +1,8 @@ -// Copyright (C) 2021 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. +//Copyright (C) 2022 Ultimaker B.V. +//Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 import QtQuick.Window 2.2 -import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one import QtQuick.Controls 2.3 import QtQuick.Layouts 1.1 diff --git a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml index 943c58ce76..8bf39f6804 100644 --- a/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml +++ b/plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml @@ -3,7 +3,6 @@ import QtQuick 2.2 import QtQuick.Controls 2.15 -import QtQuick.Controls 1.2 as OldControls import QtQuick.Controls.Styles 1.2 import UM 1.5 as UM diff --git a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml index 422d831a7d..506dd85fac 100644 --- a/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml +++ b/resources/qml/Dialogs/DiscardOrKeepProfileChangesDialog.qml @@ -3,7 +3,6 @@ import Qt.labs.qmlmodels 1.0 import QtQuick 2.1 -import QtQuick.Controls 1.1 as OldControls import QtQuick.Controls 2.15 import QtQuick.Dialogs 1.2 import QtQuick.Window 2.1 diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 6fe7d78ebe..d1ea251ab8 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -3,7 +3,6 @@ import QtQuick 2.7 import QtQuick.Controls 2.15 -import QtQuick.Controls 1.4 as OldControls import QtQuick.Dialogs 1.2 import UM 1.5 as UM @@ -326,7 +325,6 @@ Item id: spoolWeightSpinBox width: informationPage.columnWidth value: base.getMaterialPreferenceValue(properties.guid, "spool_weight", Cura.ContainerManager.getContainerMetaDataEntry(properties.container_id, "properties/weight")) - suffix: " g" stepSize: 100 to: 10000 editable: true diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index e00c1ee3b0..3d7ceeda5e 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -2,7 +2,6 @@ //Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.7 -import QtQuick.Controls 1.4 as OldControls import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import QtQuick.Dialogs 1.2 diff --git a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml index 2925a10f17..94d55d563d 100644 --- a/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Custom/CustomPrintSetup.qml @@ -3,7 +3,6 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import QtQuick.Controls 1.4 as OldControls import QtQuick.Layouts 1.3 import UM 1.5 as UM diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml index 4d23561bf0..49be0fae1c 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml @@ -2,7 +2,6 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 as OldControls import QtQuick.Controls 2.3 import UM 1.5 as UM diff --git a/resources/qml/ProfileOverview.qml b/resources/qml/ProfileOverview.qml index ebca4ff22e..d3aa07ed06 100644 --- a/resources/qml/ProfileOverview.qml +++ b/resources/qml/ProfileOverview.qml @@ -3,7 +3,6 @@ import Qt.labs.qmlmodels 1.0 import QtQuick 2.7 -import QtQuick.Controls 1.4 as OldControls import QtQuick.Controls 2.15 import UM 1.5 as UM From cef3b5db16ca946a95d00d59c79c887fecc19b4b Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 31 Jan 2022 17:30:03 +0100 Subject: [PATCH 49/50] Fix mergeconflict CURA-8684 --- plugins/ImageReader/ConfigUI.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/plugins/ImageReader/ConfigUI.qml b/plugins/ImageReader/ConfigUI.qml index eb8b481dd7..ecfc86fc05 100644 --- a/plugins/ImageReader/ConfigUI.qml +++ b/plugins/ImageReader/ConfigUI.qml @@ -2,7 +2,6 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.1 -<<<<<<< HEAD import QtQuick.Controls 2.15 import QtQuick.Layouts 1.3 import QtQuick.Window 2.1 From ecba5b409ca6615da2a4aeea1311201703ee22b1 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 31 Jan 2022 17:32:10 +0100 Subject: [PATCH 50/50] Fix binding loop in objectItemButton CURA-8684 --- resources/qml/ObjectItemButton.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/ObjectItemButton.qml b/resources/qml/ObjectItemButton.qml index 00fe88dd7e..73295b2e69 100644 --- a/resources/qml/ObjectItemButton.qml +++ b/resources/qml/ObjectItemButton.qml @@ -82,7 +82,7 @@ Button right: parent.right rightMargin: 0 } - width: contentItem.width + width: meshTypeIcon.width + perObjectSettingsCountLabel.width + UM.Theme.getSize("narrow_margin").width height: parent.height padding: 0 leftPadding: UM.Theme.getSize("thin_margin").width @@ -131,7 +131,7 @@ Button contentItem: Item { height: parent.height - width: meshTypeIcon.width + perObjectSettingsCountLabel.width + UM.Theme.getSize("narrow_margin").width + width: perObjectSettingsInfo.width Cura.NotificationIcon {