From cac27770ce785794e3efc5e456ca040c547ea660 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 19 Jan 2022 10:46:31 +0100 Subject: [PATCH 01/17] Add new design checkbox svg icons. --- resources/themes/cura-light/icons/default/CheckBoxBorder.svg | 4 ++++ resources/themes/cura-light/icons/low/CheckBoxFill.svg | 4 ++++ resources/themes/cura-light/icons/low/EmptyCheck.svg | 3 +++ 3 files changed, 11 insertions(+) create mode 100644 resources/themes/cura-light/icons/default/CheckBoxBorder.svg create mode 100644 resources/themes/cura-light/icons/low/CheckBoxFill.svg create mode 100644 resources/themes/cura-light/icons/low/EmptyCheck.svg diff --git a/resources/themes/cura-light/icons/default/CheckBoxBorder.svg b/resources/themes/cura-light/icons/default/CheckBoxBorder.svg new file mode 100644 index 0000000000..44076e5e0a --- /dev/null +++ b/resources/themes/cura-light/icons/default/CheckBoxBorder.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/themes/cura-light/icons/low/CheckBoxFill.svg b/resources/themes/cura-light/icons/low/CheckBoxFill.svg new file mode 100644 index 0000000000..bfbb6d87f2 --- /dev/null +++ b/resources/themes/cura-light/icons/low/CheckBoxFill.svg @@ -0,0 +1,4 @@ + + + + diff --git a/resources/themes/cura-light/icons/low/EmptyCheck.svg b/resources/themes/cura-light/icons/low/EmptyCheck.svg new file mode 100644 index 0000000000..9630b70052 --- /dev/null +++ b/resources/themes/cura-light/icons/low/EmptyCheck.svg @@ -0,0 +1,3 @@ + + + From c54c375a7c5ed7a1a5500f1aa69c8e5001be2493 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 19 Jan 2022 17:56:56 +0100 Subject: [PATCH 02/17] Update check box icons name to new icon name Change checkbox check icon to have set height and width in theme.json. Math.round(parent.width/2.5) would always evaluate to 1 since the width of the check icons parent is fixed. --- resources/qml/CheckBoxWithTooltip.qml | 6 +++--- resources/qml/Settings/SettingCheckBox.qml | 12 ++++++------ resources/qml/Widgets/CheckBox.qml | 6 +++--- resources/themes/cura-light/styles.qml | 14 +++++++------- 4 files changed, 19 insertions(+), 19 deletions(-) diff --git a/resources/qml/CheckBoxWithTooltip.qml b/resources/qml/CheckBoxWithTooltip.qml index e17940014a..60315a05f0 100644 --- a/resources/qml/CheckBoxWithTooltip.qml +++ b/resources/qml/CheckBoxWithTooltip.qml @@ -28,11 +28,11 @@ CheckBox { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.round(parent.width / 2.5) - height: Math.round(parent.height / 2.5) + height: UM.Theme.getSize("checkbox_mark").height + width: UM.Theme.getSize("checkbox_mark").width sourceSize.height: width color: UM.Theme.getColor("checkbox_mark") - source: UM.Theme.getIcon("Check") + source: UM.Theme.getIcon("EmptyCheck", "low") opacity: checkbox.checked Behavior on opacity { NumberAnimation { duration: 100; } } } diff --git a/resources/qml/Settings/SettingCheckBox.qml b/resources/qml/Settings/SettingCheckBox.qml index 20693b92e3..5f5d44700b 100644 --- a/resources/qml/Settings/SettingCheckBox.qml +++ b/resources/qml/Settings/SettingCheckBox.qml @@ -85,11 +85,11 @@ SettingItem { anchors { - top: parent.top - bottom: parent.bottom + verticalCenter: parent.verticalCenter left: parent.left } - width: height + width: UM.Theme.getSize("checkbox").width + height: width radius: UM.Theme.getSize("setting_control_radius").width border.width: UM.Theme.getSize("default_lining").width @@ -147,11 +147,11 @@ SettingItem { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.round(parent.width / 2.5) - height: Math.round(parent.height / 2.5) + height: UM.Theme.getSize("checkbox_mark").height + width: UM.Theme.getSize("checkbox_mark").width sourceSize.height: width color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text"); - source: UM.Theme.getIcon("Check") + source: UM.Theme.getIcon("EmptyCheck", "low") opacity: control.checked ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 100; } } } diff --git a/resources/qml/Widgets/CheckBox.qml b/resources/qml/Widgets/CheckBox.qml index 295283d76e..fde7458ede 100644 --- a/resources/qml/Widgets/CheckBox.qml +++ b/resources/qml/Widgets/CheckBox.qml @@ -54,11 +54,11 @@ CheckBox { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.round(parent.width / 2.5) - height: Math.round(parent.height / 2.5) + height: UM.Theme.getSize("checkbox_mark").height + width: UM.Theme.getSize("checkbox_mark").width sourceSize.height: width color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") - source: UM.Theme.getIcon("Check") + source: UM.Theme.getIcon("EmptyCheck", "low") opacity: control.checked ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 100; } } } diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 1320b54f37..84ba65393e 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -408,7 +408,7 @@ QtObject color: (control.hovered || control._hovered) ? UM.Theme.getColor("checkbox_hover") : (control.enabled ? UM.Theme.getColor("checkbox") : UM.Theme.getColor("checkbox_disabled")) Behavior on color { ColorAnimation { duration: 50; } } - + anchors.verticalCenter: parent.verticalCenter radius: control.exclusiveGroup ? Math.round(UM.Theme.getSize("checkbox").width / 2) : UM.Theme.getSize("checkbox_radius").width border.width: UM.Theme.getSize("default_lining").width @@ -418,11 +418,11 @@ QtObject { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.round(parent.width / 2.5) - height: Math.round(parent.height / 2.5) + height: UM.Theme.getSize("checkbox_mark").height + width: UM.Theme.getSize("checkbox_mark").width sourceSize.height: width color: UM.Theme.getColor("checkbox_mark") - source: control.exclusiveGroup ? UM.Theme.getIcon("Dot") : UM.Theme.getIcon("Check") + source: control.exclusiveGroup ? UM.Theme.getIcon("Dot") : UM.Theme.getIcon("EmptyCheck", "low") opacity: control.checked Behavior on opacity { NumberAnimation { duration: 100; } } } @@ -460,8 +460,8 @@ QtObject { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - width: Math.round(parent.width / 2.5) - height: Math.round(parent.height / 2.5) + height: UM.Theme.getSize("checkbox_mark").height + width: UM.Theme.getSize("checkbox_mark").width sourceSize.height: width color: UM.Theme.getColor("checkbox_mark") source: @@ -472,7 +472,7 @@ QtObject } else { - return control.exclusiveGroup ? UM.Theme.getIcon("Dot", "low") : UM.Theme.getIcon("Check"); + return control.exclusiveGroup ? UM.Theme.getIcon("Dot", "low") : UM.Theme.getIcon("EmptyCheck", "low"); } } opacity: control.checked From 16e4ee58a9af8d5dfe7a074e8764d524cdb4c241 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 19 Jan 2022 18:04:29 +0100 Subject: [PATCH 03/17] Update Machine Settings Menu checkboxes to new style. Change height of setting row to be set by TooltipArea instead of Checkbox and center Checkbox within TooltipArea --- resources/qml/MachineSettings/SimpleCheckBox.qml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/resources/qml/MachineSettings/SimpleCheckBox.qml b/resources/qml/MachineSettings/SimpleCheckBox.qml index 821c68745a..571518a9bd 100644 --- a/resources/qml/MachineSettings/SimpleCheckBox.qml +++ b/resources/qml/MachineSettings/SimpleCheckBox.qml @@ -20,7 +20,7 @@ UM.TooltipArea property int controlHeight: UM.Theme.getSize("setting_control").height - height: childrenRect.height + height: controlHeight width: childrenRect.width text: tooltip @@ -60,10 +60,13 @@ UM.TooltipArea Cura.CheckBox { id: checkBox - anchors.left: fieldLabel.right - anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors { + left: fieldLabel.right + leftMargin: UM.Theme.getSize("default_margin").width + verticalCenter: parent.verticalCenter + } checked: String(propertyProvider.properties.value).toLowerCase() != 'false' - height: simpleCheckBox.controlHeight + height: UM.Theme.getSize("checkbox").height text: "" onClicked: { From 25fa71b0567d02416a97ab69ba8b347fbe0b76ca Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 19 Jan 2022 18:06:47 +0100 Subject: [PATCH 04/17] Update checkbox style to reflect new design. Add checkbox_mark size for icons inside checkbox instead of dynamically assigning size. This is related to previous commit about Math.round(parent.width/2.5) always resolving to 1 --- resources/themes/cura-light/theme.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index f59231d960..2276c39744 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -604,8 +604,9 @@ "layerview_row": [11.0, 1.5], "layerview_row_spacing": [0.0, 0.5], - "checkbox": [1.5, 1.5], - "checkbox_radius": [0.08, 0.08], + "checkbox": [1.33, 1.33], + "checkbox_mark": [1, 1], + "checkbox_radius": [0.25, 0.25], "tooltip": [20.0, 10.0], "tooltip_margins": [1.0, 1.0], From 670872f8d142e1d07512291e0903d79f1ffd5738 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 20 Jan 2022 17:31:00 +0100 Subject: [PATCH 05/17] Specify width and height in Cura.Checkbox Update Dialogs to use Cura.CheckBox instead of QtQuick. This will make it easier to update the QtQuick checkbox version. --- plugins/PerObjectSettingsTool/SettingPickDialog.qml | 4 ++-- resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml | 8 +------- resources/qml/Dialogs/WorkspaceSummaryDialog.qml | 2 +- resources/qml/Widgets/CheckBox.qml | 3 +++ 4 files changed, 7 insertions(+), 10 deletions(-) diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index 1bba094e49..9d29c46379 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -57,12 +57,12 @@ UM.Dialog onTextChanged: settingPickDialog.updateFilter() } - CheckBox + Cura.CheckBox { id: toggleShowAll anchors { - top: parent.top + verticalCenter: parent.verticalCenter right: parent.right } text: catalog.i18nc("@label:checkbox", "Show all") diff --git a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml index ba0d3fb6ca..94f3f4331b 100644 --- a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml +++ b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml @@ -92,17 +92,11 @@ UM.Dialog wrapMode: Text.WordWrap } - CheckBox + Cura.CheckBox { id: rememberChoiceCheckBox text: catalog.i18nc("@text:window", "Remember my choice") checked: UM.Preferences.getValue("cura/choice_on_open_project") != "always_ask" - style: CheckBoxStyle { - label: Label { - text: control.text - font: UM.Theme.getFont("default") - } - } } // Buttons diff --git a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml index 9e0e972361..02ddd43203 100644 --- a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml +++ b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml @@ -275,7 +275,7 @@ UM.Dialog width: parent.width height: childrenRect.height anchors.bottom: parent.bottom - CheckBox + Cura.CheckBox { id: dontShowAgainCheckbox anchors.left: parent.left diff --git a/resources/qml/Widgets/CheckBox.qml b/resources/qml/Widgets/CheckBox.qml index fde7458ede..84b074af71 100644 --- a/resources/qml/Widgets/CheckBox.qml +++ b/resources/qml/Widgets/CheckBox.qml @@ -17,6 +17,9 @@ CheckBox hoverEnabled: true + height: UM.Theme.getSize("checkbox").height + width: UM.Theme.getSize("checkbox").width + indicator: Rectangle { width: control.height From 171da643d524c9d6752720099c92e747c2044585 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 21 Jan 2022 18:06:31 +0100 Subject: [PATCH 06/17] I'm replacing all CheckBox in Cura with this CheckBox except ones that use the old "style" tag (Not in scope). This should make the design consistent everywhere and easier to update. Moved set width and height from top level into "indicator" since this was causing the label to be cut off. Swapped out setting_control_radius for checkbox_radius since these are different now. Updated the UM.RecolorImage to work with tri state checkboxes so this can replace the Checkbox in SettingVisiblityPage.qml. --- resources/qml/Widgets/CheckBox.qml | 60 ++++++++++++++++++++------ resources/themes/cura-light/theme.json | 3 ++ 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/resources/qml/Widgets/CheckBox.qml b/resources/qml/Widgets/CheckBox.qml index 84b074af71..e60384d565 100644 --- a/resources/qml/Widgets/CheckBox.qml +++ b/resources/qml/Widgets/CheckBox.qml @@ -17,13 +17,12 @@ CheckBox hoverEnabled: true - height: UM.Theme.getSize("checkbox").height - width: UM.Theme.getSize("checkbox").width - indicator: Rectangle { - width: control.height - height: control.height + height: UM.Theme.getSize("checkbox").height + width: UM.Theme.getSize("checkbox").width + + anchors.verticalCenter: parent.verticalCenter color: { @@ -38,7 +37,7 @@ CheckBox return UM.Theme.getColor("setting_control") } - radius: UM.Theme.getSize("setting_control_radius").width + radius: UM.Theme.getSize("checkbox_radius").width border.width: UM.Theme.getSize("default_lining").width border.color: { @@ -57,12 +56,46 @@ CheckBox { anchors.verticalCenter: parent.verticalCenter anchors.horizontalCenter: parent.horizontalCenter - height: UM.Theme.getSize("checkbox_mark").height - width: UM.Theme.getSize("checkbox_mark").width - sourceSize.height: width - color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text") - source: UM.Theme.getIcon("EmptyCheck", "low") - opacity: control.checked ? 1 : 0 + + height: + { + switch(control.checkState) + { + case Qt.Checked: return UM.Theme.getSize("checkbox_mark").height + case Qt.PartiallyChecked: return UM.Theme.getSize("checkbox_square").height + default: UM.Theme.getSize("checkbox_mark").height + } + } + width: height + sourceSize.height: height + + color: + { + switch(control.checkState) + { + case Qt.Checked: return !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("checkbox_mark") + case Qt.PartiallyChecked: return !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("checkbox_square") + default: return !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("checkbox_mark") + } + } + source: + { + switch (control.checkState) + { + case Qt.Checked: return UM.Theme.getIcon("EmptyCheck", "low") + case Qt.PartiallyChecked: return UM.Theme.getIcon("CheckBoxFill", "low") + default: return UM.Theme.getIcon("EmptyCheck", "low") + } + } + opacity: + { + switch (control.checkState) + { + case Qt.Checked: return 1; + case Qt.PartiallyChecked: return 1; + default: 0; + } + } Behavior on opacity { NumberAnimation { duration: 100; } } } } @@ -70,7 +103,8 @@ CheckBox contentItem: Label { id: textLabel - leftPadding: control.indicator.width + control.spacing + anchors.left: control.indicator.right + leftPadding: UM.Theme.getSize("checkbox_label_padding").width text: control.text font: control.font color: UM.Theme.getColor("text") diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 2276c39744..e98b734a1d 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -352,6 +352,7 @@ "checkbox_border": [199, 199, 199, 255], "checkbox_border_hover": [50, 130, 255, 255], "checkbox_mark": [35, 35, 35, 255], + "checkbox_square": [180, 180, 180, 255], "checkbox_disabled": [223, 223, 223, 255], "checkbox_text": [35, 35, 35, 255], @@ -606,7 +607,9 @@ "checkbox": [1.33, 1.33], "checkbox_mark": [1, 1], + "checkbox_square": [0.83, 0.83], "checkbox_radius": [0.25, 0.25], + "checkbox_label_padding": [0.5, 0.5], "tooltip": [20.0, 10.0], "tooltip_margins": [1.0, 1.0], From 951e1cb37b005782d30ae59992c7102955579a7b Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 21 Jan 2022 18:07:45 +0100 Subject: [PATCH 07/17] Swap CheckBox for styled Cura.CheckBox --- .../PerObjectSettingsTool/PerObjectItem.qml | 4 +- resources/qml/Preferences/GeneralPage.qml | 42 +++++++++---------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/plugins/PerObjectSettingsTool/PerObjectItem.qml b/plugins/PerObjectSettingsTool/PerObjectItem.qml index bb1c31e1f3..00f5c305c5 100644 --- a/plugins/PerObjectSettingsTool/PerObjectItem.qml +++ b/plugins/PerObjectSettingsTool/PerObjectItem.qml @@ -8,6 +8,8 @@ import QtQuick.Controls.Styles 1.1 import UM 1.2 as UM +import Cura 1.0 as Cura + UM.TooltipArea { x: model.depth * UM.Theme.getSize("default_margin").width; @@ -16,7 +18,7 @@ UM.TooltipArea width: childrenRect.width; height: childrenRect.height; - CheckBox + Cura.CheckBox { id: check diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 7ea89e34ba..ad6e36d9f6 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -291,7 +291,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Slice automatically when changing settings.") - CheckBox + Cura.CheckBox { id: autoSliceCheckbox checked: boolCheck(UM.Preferences.getValue("general/auto_slice")) @@ -321,7 +321,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Highlight unsupported areas of the model in red. Without support these areas will not print properly.") - CheckBox + Cura.CheckBox { id: showOverhangCheckbox @@ -340,7 +340,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Highlight missing or extraneous surfaces of the model using warning signs. The toolpaths will often be missing parts of the intended geometry.") - CheckBox + Cura.CheckBox { id: showXrayErrorCheckbox @@ -357,7 +357,7 @@ UM.PreferencesPage height: childrenRect.height; text: catalog.i18nc("@info:tooltip", "Moves the camera so the model is in the center of the view when a model is selected") - CheckBox + Cura.CheckBox { id: centerOnSelectCheckbox text: catalog.i18nc("@action:button","Center camera when item is selected"); @@ -372,7 +372,7 @@ UM.PreferencesPage height: childrenRect.height; text: catalog.i18nc("@info:tooltip", "Should the default zoom behavior of cura be inverted?") - CheckBox + Cura.CheckBox { id: invertZoomCheckbox text: catalog.i18nc("@action:button", "Invert the direction of camera zoom."); @@ -393,7 +393,7 @@ UM.PreferencesPage height: childrenRect.height; text: zoomToMouseCheckbox.enabled ? catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") : catalog.i18nc("@info:tooltip", "Zooming towards the mouse is not supported in the orthographic perspective.") - CheckBox + Cura.CheckBox { id: zoomToMouseCheckbox text: catalog.i18nc("@action:button", "Zoom toward mouse direction") @@ -424,7 +424,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved so that they no longer intersect?") - CheckBox + Cura.CheckBox { id: pushFreeCheckbox text: catalog.i18nc("@option:check", "Ensure models are kept apart") @@ -438,7 +438,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved down to touch the build plate?") - CheckBox + Cura.CheckBox { id: dropDownCheckbox text: catalog.i18nc("@option:check", "Automatically drop models to the build plate") @@ -455,7 +455,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip","Show caution message in g-code reader.") - CheckBox + Cura.CheckBox { id: gcodeShowCautionCheckbox @@ -472,7 +472,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should layer be forced into compatibility mode?") - CheckBox + Cura.CheckBox { id: forceLayerViewCompatibilityModeCheckbox text: catalog.i18nc("@option:check", "Force layer view compatibility mode (restart required)") @@ -487,7 +487,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should Cura open at the location it was closed?") - CheckBox + Cura.CheckBox { id: restoreWindowPositionCheckbox text: catalog.i18nc("@option:check", "Restore window position on start") @@ -562,7 +562,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should opening files from the desktop or external applications open in the same instance of Cura?") - CheckBox + Cura.CheckBox { id: singleInstanceCheckbox text: catalog.i18nc("@option:check","Use a single instance of Cura") @@ -578,7 +578,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip","Should the build plate be cleared before loading a new model in the single instance of Cura?") enabled: singleInstanceCheckbox.checked - CheckBox + Cura.CheckBox { id: singleInstanceClearBeforeLoadCheckbox text: catalog.i18nc("@option:check","Clear buildplate before loading model into the single instance") @@ -593,7 +593,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should models be scaled to the build volume if they are too large?") - CheckBox + Cura.CheckBox { id: scaleToFitCheckbox text: catalog.i18nc("@option:check","Scale large models") @@ -608,7 +608,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","An model may appear extremely small if its unit is for example in meters rather than millimeters. Should these models be scaled up?") - CheckBox + Cura.CheckBox { id: scaleTinyCheckbox text: catalog.i18nc("@option:check","Scale extremely small models") @@ -623,7 +623,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should models be selected after they are loaded?") - CheckBox + Cura.CheckBox { id: selectModelsOnLoadCheckbox text: catalog.i18nc("@option:check","Select models when loaded") @@ -638,7 +638,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should a prefix based on the printer name be added to the print job name automatically?") - CheckBox + Cura.CheckBox { id: prefixJobNameCheckbox text: catalog.i18nc("@option:check", "Add machine prefix to job name") @@ -653,7 +653,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a project file?") - CheckBox + Cura.CheckBox { text: catalog.i18nc("@option:check", "Show summary dialog when saving project") checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_project_save")) @@ -798,7 +798,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should anonymous data about your print be sent to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.") - CheckBox + Cura.CheckBox { id: sendDataCheckbox text: catalog.i18nc("@option:check","Send (anonymous) print information") @@ -837,7 +837,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should Cura check for updates when the program is started?") - CheckBox + Cura.CheckBox { id: checkUpdatesCheckbox text: catalog.i18nc("@option:check","Check for updates on start") @@ -885,7 +885,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should an automatic check for new plugins be done every time Cura is started? It is highly recommended that you do not disable this!") - CheckBox + Cura.CheckBox { id: pluginNotificationsUpdateCheckbox text: catalog.i18nc("@option:check", "Get notifications for plugin updates") From 9b11483428de0726205acb7ec5bed9204b093f5d Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 21 Jan 2022 18:09:02 +0100 Subject: [PATCH 08/17] Cura.Checkbox requires vertical alignment since it no longer takes up the same amount of vertical space. --- plugins/PerObjectSettingsTool/SettingPickDialog.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index 9d29c46379..572c10e50a 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -62,7 +62,7 @@ UM.Dialog id: toggleShowAll anchors { - verticalCenter: parent.verticalCenter + top: parent.top right: parent.right } text: catalog.i18nc("@label:checkbox", "Show all") From 4c9c2ad131dbd047a1c5c0b03a2ba4fd9aa67f4c Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Fri, 21 Jan 2022 18:16:16 +0100 Subject: [PATCH 09/17] "checkedState" is now "checkState" in newer CheckBox Remove partiallyCheckedEnabled since Cura.CheckBox manages this itself. --- resources/qml/Preferences/SettingVisibilityPage.qml | 7 +++---- resources/qml/Widgets/MenuItem.qml | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index d2fd5c7e94..8618030bc7 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -36,7 +36,7 @@ UM.PreferencesPage id: base; anchors.fill: parent; - CheckBox + Cura.CheckBox { id: toggleVisibleSettings anchors @@ -46,7 +46,7 @@ UM.PreferencesPage leftMargin: UM.Theme.getSize("default_margin").width } text: catalog.i18nc("@label:textbox", "Check all") - checkedState: + checkState: { if(definitionsModel.visibleCount == definitionsModel.categoryCount) { @@ -61,14 +61,13 @@ UM.PreferencesPage return Qt.PartiallyChecked } } - partiallyCheckedEnabled: true MouseArea { anchors.fill: parent; onClicked: { - if(parent.checkedState == Qt.Unchecked || parent.checkedState == Qt.PartiallyChecked) + if(parent.checkState == Qt.Unchecked || parent.checkState == Qt.PartiallyChecked) { definitionsModel.setAllExpandedVisible(true) } diff --git a/resources/qml/Widgets/MenuItem.qml b/resources/qml/Widgets/MenuItem.qml index f0824b4d98..b937687086 100644 --- a/resources/qml/Widgets/MenuItem.qml +++ b/resources/qml/Widgets/MenuItem.qml @@ -37,7 +37,7 @@ MenuItem anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width - source: UM.Theme.getIcon("Check") + source: UM.Theme.getIcon("EmptyCheck", "low") color: UM.Theme.getColor("setting_control_text") } From 5788ea8d00c1f009ac7fad51a07e09f3f9b71111 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 24 Jan 2022 14:03:47 +0100 Subject: [PATCH 10/17] The visibility settings in the preferences is defined in Uranium rather than Cura. The CheckBox has been moved to Uranium so that all parts of the project have access to this default styled component. --- .../resources/qml/SaveProjectFilesPage.qml | 4 +- .../PerObjectSettingsTool/PerObjectItem.qml | 2 +- .../SettingPickDialog.qml | 2 +- .../UMOUpgradeSelectionMachineAction.qml | 2 +- .../AskOpenAsProjectOrModelsDialog.qml | 2 +- .../qml/Dialogs/WorkspaceSummaryDialog.qml | 2 +- .../qml/MachineSettings/SimpleCheckBox.qml | 2 +- resources/qml/Preferences/GeneralPage.qml | 42 +++---- .../qml/Preferences/SettingVisibilityPage.qml | 2 +- resources/qml/Widgets/CheckBox.qml | 114 ------------------ 10 files changed, 30 insertions(+), 144 deletions(-) delete mode 100644 resources/qml/Widgets/CheckBox.qml diff --git a/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml b/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml index d8ae78d96d..4021888418 100644 --- a/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml +++ b/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml @@ -228,7 +228,7 @@ Item width: childrenRect.width spacing: UM.Theme.getSize("default_margin").width - Cura.CheckBox + UM.CheckBox { id: asProjectCheckbox height: UM.Theme.getSize("checkbox").height @@ -238,7 +238,7 @@ Item font: UM.Theme.getFont("medium") } - Cura.CheckBox + UM.CheckBox { id: asSlicedCheckbox height: UM.Theme.getSize("checkbox").height diff --git a/plugins/PerObjectSettingsTool/PerObjectItem.qml b/plugins/PerObjectSettingsTool/PerObjectItem.qml index 00f5c305c5..811d15fc0e 100644 --- a/plugins/PerObjectSettingsTool/PerObjectItem.qml +++ b/plugins/PerObjectSettingsTool/PerObjectItem.qml @@ -18,7 +18,7 @@ UM.TooltipArea width: childrenRect.width; height: childrenRect.height; - Cura.CheckBox + UM.CheckBox { id: check diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index 572c10e50a..787b9a709d 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -57,7 +57,7 @@ UM.Dialog onTextChanged: settingPickDialog.updateFilter() } - Cura.CheckBox + UM.CheckBox { id: toggleShowAll anchors diff --git a/plugins/UltimakerMachineActions/UMOUpgradeSelectionMachineAction.qml b/plugins/UltimakerMachineActions/UMOUpgradeSelectionMachineAction.qml index 565ba2fa0e..de788bf466 100644 --- a/plugins/UltimakerMachineActions/UMOUpgradeSelectionMachineAction.qml +++ b/plugins/UltimakerMachineActions/UMOUpgradeSelectionMachineAction.qml @@ -33,7 +33,7 @@ Cura.MachineAction renderType: Text.NativeRendering } - Cura.CheckBox + UM.CheckBox { anchors.top: pageDescription.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height diff --git a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml index 94f3f4331b..f6428e143b 100644 --- a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml +++ b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml @@ -92,7 +92,7 @@ UM.Dialog wrapMode: Text.WordWrap } - Cura.CheckBox + UM.CheckBox { id: rememberChoiceCheckBox text: catalog.i18nc("@text:window", "Remember my choice") diff --git a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml index 02ddd43203..b55fae1f13 100644 --- a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml +++ b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml @@ -275,7 +275,7 @@ UM.Dialog width: parent.width height: childrenRect.height anchors.bottom: parent.bottom - Cura.CheckBox + UM.CheckBox { id: dontShowAgainCheckbox anchors.left: parent.left diff --git a/resources/qml/MachineSettings/SimpleCheckBox.qml b/resources/qml/MachineSettings/SimpleCheckBox.qml index 571518a9bd..5210290487 100644 --- a/resources/qml/MachineSettings/SimpleCheckBox.qml +++ b/resources/qml/MachineSettings/SimpleCheckBox.qml @@ -57,7 +57,7 @@ UM.TooltipArea renderType: Text.NativeRendering } - Cura.CheckBox + UM.CheckBox { id: checkBox anchors { diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 6b20e48bc0..ec328baaa6 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -304,7 +304,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Slice automatically when changing settings.") - Cura.CheckBox + UM.CheckBox { id: autoSliceCheckbox checked: boolCheck(UM.Preferences.getValue("general/auto_slice")) @@ -334,7 +334,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Highlight unsupported areas of the model in red. Without support these areas will not print properly.") - Cura.CheckBox + UM.CheckBox { id: showOverhangCheckbox @@ -353,7 +353,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip", "Highlight missing or extraneous surfaces of the model using warning signs. The toolpaths will often be missing parts of the intended geometry.") - Cura.CheckBox + UM.CheckBox { id: showXrayErrorCheckbox @@ -370,7 +370,7 @@ UM.PreferencesPage height: childrenRect.height; text: catalog.i18nc("@info:tooltip", "Moves the camera so the model is in the center of the view when a model is selected") - Cura.CheckBox + UM.CheckBox { id: centerOnSelectCheckbox text: catalog.i18nc("@action:button","Center camera when item is selected"); @@ -385,7 +385,7 @@ UM.PreferencesPage height: childrenRect.height; text: catalog.i18nc("@info:tooltip", "Should the default zoom behavior of cura be inverted?") - Cura.CheckBox + UM.CheckBox { id: invertZoomCheckbox text: catalog.i18nc("@action:button", "Invert the direction of camera zoom."); @@ -406,7 +406,7 @@ UM.PreferencesPage height: childrenRect.height; text: zoomToMouseCheckbox.enabled ? catalog.i18nc("@info:tooltip", "Should zooming move in the direction of the mouse?") : catalog.i18nc("@info:tooltip", "Zooming towards the mouse is not supported in the orthographic perspective.") - Cura.CheckBox + UM.CheckBox { id: zoomToMouseCheckbox text: catalog.i18nc("@action:button", "Zoom toward mouse direction") @@ -437,7 +437,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved so that they no longer intersect?") - Cura.CheckBox + UM.CheckBox { id: pushFreeCheckbox text: catalog.i18nc("@option:check", "Ensure models are kept apart") @@ -451,7 +451,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should models on the platform be moved down to touch the build plate?") - Cura.CheckBox + UM.CheckBox { id: dropDownCheckbox text: catalog.i18nc("@option:check", "Automatically drop models to the build plate") @@ -468,7 +468,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip","Show caution message in g-code reader.") - Cura.CheckBox + UM.CheckBox { id: gcodeShowCautionCheckbox @@ -485,7 +485,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should layer be forced into compatibility mode?") - Cura.CheckBox + UM.CheckBox { id: forceLayerViewCompatibilityModeCheckbox text: catalog.i18nc("@option:check", "Force layer view compatibility mode (restart required)") @@ -500,7 +500,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should Cura open at the location it was closed?") - Cura.CheckBox + UM.CheckBox { id: restoreWindowPositionCheckbox text: catalog.i18nc("@option:check", "Restore window position on start") @@ -575,7 +575,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should opening files from the desktop or external applications open in the same instance of Cura?") - Cura.CheckBox + UM.CheckBox { id: singleInstanceCheckbox text: catalog.i18nc("@option:check","Use a single instance of Cura") @@ -591,7 +591,7 @@ UM.PreferencesPage text: catalog.i18nc("@info:tooltip","Should the build plate be cleared before loading a new model in the single instance of Cura?") enabled: singleInstanceCheckbox.checked - Cura.CheckBox + UM.CheckBox { id: singleInstanceClearBeforeLoadCheckbox text: catalog.i18nc("@option:check","Clear buildplate before loading model into the single instance") @@ -606,7 +606,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should models be scaled to the build volume if they are too large?") - Cura.CheckBox + UM.CheckBox { id: scaleToFitCheckbox text: catalog.i18nc("@option:check","Scale large models") @@ -621,7 +621,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","An model may appear extremely small if its unit is for example in meters rather than millimeters. Should these models be scaled up?") - Cura.CheckBox + UM.CheckBox { id: scaleTinyCheckbox text: catalog.i18nc("@option:check","Scale extremely small models") @@ -636,7 +636,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip","Should models be selected after they are loaded?") - Cura.CheckBox + UM.CheckBox { id: selectModelsOnLoadCheckbox text: catalog.i18nc("@option:check","Select models when loaded") @@ -651,7 +651,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should a prefix based on the printer name be added to the print job name automatically?") - Cura.CheckBox + UM.CheckBox { id: prefixJobNameCheckbox text: catalog.i18nc("@option:check", "Add machine prefix to job name") @@ -666,7 +666,7 @@ UM.PreferencesPage height: childrenRect.height text: catalog.i18nc("@info:tooltip", "Should a summary be shown when saving a project file?") - Cura.CheckBox + UM.CheckBox { text: catalog.i18nc("@option:check", "Show summary dialog when saving project") checked: boolCheck(UM.Preferences.getValue("cura/dialog_on_project_save")) @@ -811,7 +811,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should anonymous data about your print be sent to Ultimaker? Note, no models, IP addresses or other personally identifiable information is sent or stored.") - Cura.CheckBox + UM.CheckBox { id: sendDataCheckbox text: catalog.i18nc("@option:check","Send (anonymous) print information") @@ -850,7 +850,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should Cura check for updates when the program is started?") - Cura.CheckBox + UM.CheckBox { id: checkUpdatesCheckbox text: catalog.i18nc("@option:check","Check for updates on start") @@ -898,7 +898,7 @@ UM.PreferencesPage height: visible ? childrenRect.height : 0 text: catalog.i18nc("@info:tooltip", "Should an automatic check for new plugins be done every time Cura is started? It is highly recommended that you do not disable this!") - Cura.CheckBox + UM.CheckBox { id: pluginNotificationsUpdateCheckbox text: catalog.i18nc("@option:check", "Get notifications for plugin updates") diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index 8618030bc7..14d6ae4f22 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -36,7 +36,7 @@ UM.PreferencesPage id: base; anchors.fill: parent; - Cura.CheckBox + UM.CheckBox { id: toggleVisibleSettings anchors diff --git a/resources/qml/Widgets/CheckBox.qml b/resources/qml/Widgets/CheckBox.qml deleted file mode 100644 index e60384d565..0000000000 --- a/resources/qml/Widgets/CheckBox.qml +++ /dev/null @@ -1,114 +0,0 @@ -// Copyright (c) 2020 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.10 -import QtQuick.Controls 2.3 - -import UM 1.3 as UM -import Cura 1.1 as Cura - - -// -// Checkbox with Cura styling. -// -CheckBox -{ - id: control - - hoverEnabled: true - - indicator: Rectangle - { - height: UM.Theme.getSize("checkbox").height - width: UM.Theme.getSize("checkbox").width - - anchors.verticalCenter: parent.verticalCenter - - color: - { - if (!control.enabled) - { - return UM.Theme.getColor("setting_control_disabled") - } - if (control.hovered || control.activeFocus) - { - return UM.Theme.getColor("setting_control_highlight") - } - return UM.Theme.getColor("setting_control") - } - - radius: UM.Theme.getSize("checkbox_radius").width - border.width: UM.Theme.getSize("default_lining").width - border.color: - { - if (!enabled) - { - return UM.Theme.getColor("setting_control_disabled_border") - } - if (control.hovered || control.activeFocus) - { - return UM.Theme.getColor("setting_control_border_highlight") - } - return UM.Theme.getColor("setting_control_border") - } - - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - - height: - { - switch(control.checkState) - { - case Qt.Checked: return UM.Theme.getSize("checkbox_mark").height - case Qt.PartiallyChecked: return UM.Theme.getSize("checkbox_square").height - default: UM.Theme.getSize("checkbox_mark").height - } - } - width: height - sourceSize.height: height - - color: - { - switch(control.checkState) - { - case Qt.Checked: return !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("checkbox_mark") - case Qt.PartiallyChecked: return !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("checkbox_square") - default: return !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("checkbox_mark") - } - } - source: - { - switch (control.checkState) - { - case Qt.Checked: return UM.Theme.getIcon("EmptyCheck", "low") - case Qt.PartiallyChecked: return UM.Theme.getIcon("CheckBoxFill", "low") - default: return UM.Theme.getIcon("EmptyCheck", "low") - } - } - opacity: - { - switch (control.checkState) - { - case Qt.Checked: return 1; - case Qt.PartiallyChecked: return 1; - default: 0; - } - } - Behavior on opacity { NumberAnimation { duration: 100; } } - } - } - - contentItem: Label - { - id: textLabel - anchors.left: control.indicator.right - leftPadding: UM.Theme.getSize("checkbox_label_padding").width - text: control.text - font: control.font - color: UM.Theme.getColor("text") - renderType: Text.NativeRendering - verticalAlignment: Text.AlignVCenter - } -} From 818ef8e6149846f3443b4fb89a38c96d553a3220 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 24 Jan 2022 14:13:03 +0100 Subject: [PATCH 11/17] add dark theme checkbox square color --- resources/themes/cura-dark/theme.json | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 520f863972..5f9ab2cc2d 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -151,6 +151,7 @@ "checkbox_border": [255, 255, 255, 38], "checkbox_border_hover": [255, 255, 255, 38], "checkbox_mark": [255, 255, 255, 181], + "checkbox_square": [118, 118, 118, 255], "checkbox_text": [255, 255, 255, 181], "tooltip": [39, 44, 48, 255], From f6c48fdf07b1038107031885331bb7eb6e9e9635 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 24 Jan 2022 14:20:28 +0100 Subject: [PATCH 12/17] Rename EmptyCheck -> CheckMark --- resources/qml/CheckBoxWithTooltip.qml | 2 +- resources/qml/Settings/SettingCheckBox.qml | 2 +- resources/qml/Widgets/MenuItem.qml | 2 +- .../cura-light/icons/low/{EmptyCheck.svg => CheckMark.svg} | 0 resources/themes/cura-light/styles.qml | 4 ++-- 5 files changed, 5 insertions(+), 5 deletions(-) rename resources/themes/cura-light/icons/low/{EmptyCheck.svg => CheckMark.svg} (100%) diff --git a/resources/qml/CheckBoxWithTooltip.qml b/resources/qml/CheckBoxWithTooltip.qml index 60315a05f0..dae742cd86 100644 --- a/resources/qml/CheckBoxWithTooltip.qml +++ b/resources/qml/CheckBoxWithTooltip.qml @@ -32,7 +32,7 @@ CheckBox width: UM.Theme.getSize("checkbox_mark").width sourceSize.height: width color: UM.Theme.getColor("checkbox_mark") - source: UM.Theme.getIcon("EmptyCheck", "low") + source: UM.Theme.getIcon("CheckMark", "low") opacity: checkbox.checked Behavior on opacity { NumberAnimation { duration: 100; } } } diff --git a/resources/qml/Settings/SettingCheckBox.qml b/resources/qml/Settings/SettingCheckBox.qml index 5f5d44700b..64fd460d1c 100644 --- a/resources/qml/Settings/SettingCheckBox.qml +++ b/resources/qml/Settings/SettingCheckBox.qml @@ -151,7 +151,7 @@ SettingItem width: UM.Theme.getSize("checkbox_mark").width sourceSize.height: width color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text"); - source: UM.Theme.getIcon("EmptyCheck", "low") + source: UM.Theme.getIcon("CheckMark", "low") opacity: control.checked ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 100; } } } diff --git a/resources/qml/Widgets/MenuItem.qml b/resources/qml/Widgets/MenuItem.qml index b937687086..48570424df 100644 --- a/resources/qml/Widgets/MenuItem.qml +++ b/resources/qml/Widgets/MenuItem.qml @@ -37,7 +37,7 @@ MenuItem anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width - source: UM.Theme.getIcon("EmptyCheck", "low") + source: UM.Theme.getIcon("CheckMark", "low") color: UM.Theme.getColor("setting_control_text") } diff --git a/resources/themes/cura-light/icons/low/EmptyCheck.svg b/resources/themes/cura-light/icons/low/CheckMark.svg similarity index 100% rename from resources/themes/cura-light/icons/low/EmptyCheck.svg rename to resources/themes/cura-light/icons/low/CheckMark.svg diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 84ba65393e..e87ec3e825 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -422,7 +422,7 @@ QtObject width: UM.Theme.getSize("checkbox_mark").width sourceSize.height: width color: UM.Theme.getColor("checkbox_mark") - source: control.exclusiveGroup ? UM.Theme.getIcon("Dot") : UM.Theme.getIcon("EmptyCheck", "low") + source: control.exclusiveGroup ? UM.Theme.getIcon("Dot") : UM.Theme.getIcon("CheckMark", "low") opacity: control.checked Behavior on opacity { NumberAnimation { duration: 100; } } } @@ -472,7 +472,7 @@ QtObject } else { - return control.exclusiveGroup ? UM.Theme.getIcon("Dot", "low") : UM.Theme.getIcon("EmptyCheck", "low"); + return control.exclusiveGroup ? UM.Theme.getIcon("Dot", "low") : UM.Theme.getIcon("CheckMark", "low"); } } opacity: control.checked From 4eb61af5791fda0689738c1593506fedbe1db3f2 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 24 Jan 2022 16:15:41 +0100 Subject: [PATCH 13/17] Update colors to match designs --- resources/themes/cura-light/theme.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index e98b734a1d..1d5d9f61aa 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -349,12 +349,12 @@ "checkbox": [255, 255, 255, 255], "checkbox_hover": [255, 255, 255, 255], - "checkbox_border": [199, 199, 199, 255], - "checkbox_border_hover": [50, 130, 255, 255], + "checkbox_border": [180, 180, 180, 255], + "checkbox_border_hover": [25, 110, 240, 255], "checkbox_mark": [35, 35, 35, 255], "checkbox_square": [180, 180, 180, 255], "checkbox_disabled": [223, 223, 223, 255], - "checkbox_text": [35, 35, 35, 255], + "checkbox_text": [0, 12, 26, 255], "tooltip": [25, 25, 25, 255], "tooltip_text": [255, 255, 255, 255], From a73ae6b655f3a85df644265314f5cbc9072c54f3 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 25 Jan 2022 11:08:52 +0100 Subject: [PATCH 14/17] Replace Cura.CheckBoxWithTooltip with UM.CheckBox. Remove Cura.CheckBoxWithTooltip.qml from qmldir module definition. Remove Cura.CheckBox.qml from qmldir module definition as it has been moved to Uranium --- .../src/qml/components/BackupListFooter.qml | 2 +- resources/qml/CheckBoxWithTooltip.qml | 63 ------------------- resources/qml/qmldir | 2 - 3 files changed, 1 insertion(+), 66 deletions(-) delete mode 100644 resources/qml/CheckBoxWithTooltip.qml diff --git a/plugins/CuraDrive/src/qml/components/BackupListFooter.qml b/plugins/CuraDrive/src/qml/components/BackupListFooter.qml index 15af7521ed..b196ed3b22 100644 --- a/plugins/CuraDrive/src/qml/components/BackupListFooter.qml +++ b/plugins/CuraDrive/src/qml/components/BackupListFooter.qml @@ -35,7 +35,7 @@ RowLayout busy: CuraDrive.isCreatingBackup } - Cura.CheckBoxWithTooltip + UM.CheckBox { id: autoBackupEnabled checked: CuraDrive.autoBackupEnabled diff --git a/resources/qml/CheckBoxWithTooltip.qml b/resources/qml/CheckBoxWithTooltip.qml deleted file mode 100644 index dae742cd86..0000000000 --- a/resources/qml/CheckBoxWithTooltip.qml +++ /dev/null @@ -1,63 +0,0 @@ -// Copyright (c) 2018 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.7 -import QtQuick.Controls 2.1 - -import UM 1.3 as UM - -CheckBox -{ - id: checkbox - hoverEnabled: true - - property alias tooltip: tooltip.text - - indicator: Rectangle - { - implicitWidth: UM.Theme.getSize("checkbox").width - implicitHeight: UM.Theme.getSize("checkbox").height - x: 0 - anchors.verticalCenter: parent.verticalCenter - color: UM.Theme.getColor("main_background") - radius: UM.Theme.getSize("checkbox_radius").width - border.width: UM.Theme.getSize("default_lining").width - border.color: checkbox.hovered ? UM.Theme.getColor("checkbox_border_hover") : UM.Theme.getColor("checkbox_border") - - UM.RecolorImage - { - anchors.verticalCenter: parent.verticalCenter - anchors.horizontalCenter: parent.horizontalCenter - height: UM.Theme.getSize("checkbox_mark").height - width: UM.Theme.getSize("checkbox_mark").width - sourceSize.height: width - color: UM.Theme.getColor("checkbox_mark") - source: UM.Theme.getIcon("CheckMark", "low") - opacity: checkbox.checked - Behavior on opacity { NumberAnimation { duration: 100; } } - } - } - - contentItem: Label - { - anchors - { - left: checkbox.indicator.right - leftMargin: UM.Theme.getSize("narrow_margin").width - } - text: checkbox.text - color: UM.Theme.getColor("checkbox_text") - font: UM.Theme.getFont("default") - renderType: Text.NativeRendering - elide: Text.ElideRight - verticalAlignment: Text.AlignVCenter - } - - ToolTip - { - id: tooltip - text: "" - delay: 500 - visible: text != "" && checkbox.hovered - } -} diff --git a/resources/qml/qmldir b/resources/qml/qmldir index df2518c988..52d2df75ab 100644 --- a/resources/qml/qmldir +++ b/resources/qml/qmldir @@ -16,7 +16,6 @@ ViewsSelector 1.0 ViewsSelector.qml ToolbarButton 1.0 ToolbarButton.qml SettingView 1.0 SettingView.qml ProfileMenu 1.0 ProfileMenu.qml -CheckBoxWithTooltip 1.0 CheckBoxWithTooltip.qml ToolTip 1.0 ToolTip.qml @@ -28,7 +27,6 @@ WizardDialog 1.0 WizardDialog.qml # Cura/Widgets -CheckBox 1.0 CheckBox.qml ComboBox 1.0 ComboBox.qml NotificationIcon 1.0 NotificationIcon.qml RadioButton 1.0 RadioButton.qml From 0f4a49ac6d6e2ad657bc58a16b072a7b63fc739e Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 25 Jan 2022 11:09:27 +0100 Subject: [PATCH 15/17] Remove unused CheckBoxBorder.svg, the checkbox is defined using styling instead of an svg. --- resources/themes/cura-light/icons/default/CheckBoxBorder.svg | 4 ---- 1 file changed, 4 deletions(-) delete mode 100644 resources/themes/cura-light/icons/default/CheckBoxBorder.svg diff --git a/resources/themes/cura-light/icons/default/CheckBoxBorder.svg b/resources/themes/cura-light/icons/default/CheckBoxBorder.svg deleted file mode 100644 index 44076e5e0a..0000000000 --- a/resources/themes/cura-light/icons/default/CheckBoxBorder.svg +++ /dev/null @@ -1,4 +0,0 @@ - - - - From 7f81a2aa8c0ded473b14313cea03433e510bcc13 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Tue, 25 Jan 2022 11:32:41 +0100 Subject: [PATCH 16/17] Rename low quality CheckMark.svg -> Check.svg Rename low quality Check.svg -> CheckThin.svg --- resources/qml/Settings/SettingCheckBox.qml | 2 +- resources/qml/Widgets/MenuItem.qml | 2 +- resources/themes/cura-light/icons/low/Check.svg | 4 ++-- resources/themes/cura-light/icons/low/CheckMark.svg | 3 --- resources/themes/cura-light/icons/low/CheckThin.svg | 3 +++ resources/themes/cura-light/styles.qml | 4 ++-- 6 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 resources/themes/cura-light/icons/low/CheckMark.svg create mode 100644 resources/themes/cura-light/icons/low/CheckThin.svg diff --git a/resources/qml/Settings/SettingCheckBox.qml b/resources/qml/Settings/SettingCheckBox.qml index 64fd460d1c..1204c6dfe5 100644 --- a/resources/qml/Settings/SettingCheckBox.qml +++ b/resources/qml/Settings/SettingCheckBox.qml @@ -151,7 +151,7 @@ SettingItem width: UM.Theme.getSize("checkbox_mark").width sourceSize.height: width color: !enabled ? UM.Theme.getColor("setting_control_disabled_text") : UM.Theme.getColor("setting_control_text"); - source: UM.Theme.getIcon("CheckMark", "low") + source: UM.Theme.getIcon("Check", "low") opacity: control.checked ? 1 : 0 Behavior on opacity { NumberAnimation { duration: 100; } } } diff --git a/resources/qml/Widgets/MenuItem.qml b/resources/qml/Widgets/MenuItem.qml index 48570424df..96869f028f 100644 --- a/resources/qml/Widgets/MenuItem.qml +++ b/resources/qml/Widgets/MenuItem.qml @@ -37,7 +37,7 @@ MenuItem anchors.verticalCenter: parent.verticalCenter anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width - source: UM.Theme.getIcon("CheckMark", "low") + source: UM.Theme.getIcon("Check", "low") color: UM.Theme.getColor("setting_control_text") } diff --git a/resources/themes/cura-light/icons/low/Check.svg b/resources/themes/cura-light/icons/low/Check.svg index a20a9b1b70..9630b70052 100644 --- a/resources/themes/cura-light/icons/low/Check.svg +++ b/resources/themes/cura-light/icons/low/Check.svg @@ -1,3 +1,3 @@ - - + + diff --git a/resources/themes/cura-light/icons/low/CheckMark.svg b/resources/themes/cura-light/icons/low/CheckMark.svg deleted file mode 100644 index 9630b70052..0000000000 --- a/resources/themes/cura-light/icons/low/CheckMark.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/resources/themes/cura-light/icons/low/CheckThin.svg b/resources/themes/cura-light/icons/low/CheckThin.svg new file mode 100644 index 0000000000..a20a9b1b70 --- /dev/null +++ b/resources/themes/cura-light/icons/low/CheckThin.svg @@ -0,0 +1,3 @@ + + + diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index e87ec3e825..d4923cbef1 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -422,7 +422,7 @@ QtObject width: UM.Theme.getSize("checkbox_mark").width sourceSize.height: width color: UM.Theme.getColor("checkbox_mark") - source: control.exclusiveGroup ? UM.Theme.getIcon("Dot") : UM.Theme.getIcon("CheckMark", "low") + source: control.exclusiveGroup ? UM.Theme.getIcon("Dot") : UM.Theme.getIcon("Check", "low") opacity: control.checked Behavior on opacity { NumberAnimation { duration: 100; } } } @@ -472,7 +472,7 @@ QtObject } else { - return control.exclusiveGroup ? UM.Theme.getIcon("Dot", "low") : UM.Theme.getIcon("CheckMark", "low"); + return control.exclusiveGroup ? UM.Theme.getIcon("Dot", "low") : UM.Theme.getIcon("Check", "low"); } } opacity: control.checked From 05d542c8d0b7e3c991329f937e1ce0bbb9ea29bc Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Wed, 26 Jan 2022 09:53:17 +0100 Subject: [PATCH 17/17] Bump UM version for CheckBox --- plugins/CuraDrive/src/qml/components/BackupListFooter.qml | 2 +- plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml | 2 +- plugins/PerObjectSettingsTool/PerObjectItem.qml | 2 +- plugins/PerObjectSettingsTool/SettingPickDialog.qml | 2 +- .../UMOUpgradeSelectionMachineAction.qml | 2 +- resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml | 2 +- resources/qml/Dialogs/WorkspaceSummaryDialog.qml | 2 +- resources/qml/MachineSettings/SimpleCheckBox.qml | 2 +- resources/qml/Preferences/GeneralPage.qml | 2 +- resources/qml/Preferences/SettingVisibilityPage.qml | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/plugins/CuraDrive/src/qml/components/BackupListFooter.qml b/plugins/CuraDrive/src/qml/components/BackupListFooter.qml index b196ed3b22..76bd10bd66 100644 --- a/plugins/CuraDrive/src/qml/components/BackupListFooter.qml +++ b/plugins/CuraDrive/src/qml/components/BackupListFooter.qml @@ -5,7 +5,7 @@ import QtQuick 2.7 import QtQuick.Controls 2.1 import QtQuick.Layouts 1.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.0 as Cura import "../components" diff --git a/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml b/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml index 4021888418..c66556071f 100644 --- a/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml +++ b/plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml @@ -6,7 +6,7 @@ import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQ import QtQuick.Controls 2.3 import QtQuick.Controls.Styles 1.4 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.6 as Cura import DigitalFactory 1.0 as DF diff --git a/plugins/PerObjectSettingsTool/PerObjectItem.qml b/plugins/PerObjectSettingsTool/PerObjectItem.qml index 811d15fc0e..9700b2265b 100644 --- a/plugins/PerObjectSettingsTool/PerObjectItem.qml +++ b/plugins/PerObjectSettingsTool/PerObjectItem.qml @@ -6,7 +6,7 @@ import QtQuick.Layouts 1.1 import QtQuick.Controls 1.1 import QtQuick.Controls.Styles 1.1 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura diff --git a/plugins/PerObjectSettingsTool/SettingPickDialog.qml b/plugins/PerObjectSettingsTool/SettingPickDialog.qml index 787b9a709d..5d8e1c332a 100644 --- a/plugins/PerObjectSettingsTool/SettingPickDialog.qml +++ b/plugins/PerObjectSettingsTool/SettingPickDialog.qml @@ -2,7 +2,7 @@ import QtQuick 2.2 import QtQuick.Controls 1.2 import QtQuick.Controls.Styles 1.2 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura import ".." diff --git a/plugins/UltimakerMachineActions/UMOUpgradeSelectionMachineAction.qml b/plugins/UltimakerMachineActions/UMOUpgradeSelectionMachineAction.qml index de788bf466..3d7b4a054f 100644 --- a/plugins/UltimakerMachineActions/UMOUpgradeSelectionMachineAction.qml +++ b/plugins/UltimakerMachineActions/UMOUpgradeSelectionMachineAction.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura diff --git a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml index f6428e143b..53596d39ec 100644 --- a/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml +++ b/resources/qml/Dialogs/AskOpenAsProjectOrModelsDialog.qml @@ -8,7 +8,7 @@ import QtQuick.Layouts 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Window 2.1 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.0 as Cura diff --git a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml index b55fae1f13..b426f03471 100644 --- a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml +++ b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml @@ -7,7 +7,7 @@ import QtQuick.Controls 2.0 as Controls2 import QtQuick.Layouts 1.3 import QtQuick.Window 2.2 -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura UM.Dialog diff --git a/resources/qml/MachineSettings/SimpleCheckBox.qml b/resources/qml/MachineSettings/SimpleCheckBox.qml index 5210290487..cda666571f 100644 --- a/resources/qml/MachineSettings/SimpleCheckBox.qml +++ b/resources/qml/MachineSettings/SimpleCheckBox.qml @@ -5,7 +5,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.3 as UM +import UM 1.5 as UM import Cura 1.1 as Cura diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index ec328baaa6..ccdd5efcf3 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -8,7 +8,7 @@ import QtQuick.Controls.Styles 1.1 import QtQuick.Controls 2.3 as NewControls -import UM 1.1 as UM +import UM 1.5 as UM import Cura 1.1 as Cura UM.PreferencesPage diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index 14d6ae4f22..53df99b912 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -7,7 +7,7 @@ import QtQuick.Controls.Styles 1.1 import QtQuick.Controls 2.3 as NewControls -import UM 1.2 as UM +import UM 1.5 as UM import Cura 1.0 as Cura