From 83661ebd7ff1047c870e49b9677db40e1e2d7fd5 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 28 Feb 2022 12:02:51 +0100 Subject: [PATCH 01/14] Remove duplicate color for primary button. Adjust secondary button colors to account for different colors being used between light and dark themes. CURA-8688 --- resources/qml/SecondaryButton.qml | 2 +- resources/themes/cura-dark/theme.json | 2 ++ resources/themes/cura-light/theme.json | 3 +-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/resources/qml/SecondaryButton.qml b/resources/qml/SecondaryButton.qml index ba4e0bb2c1..d8027af3fc 100644 --- a/resources/qml/SecondaryButton.qml +++ b/resources/qml/SecondaryButton.qml @@ -11,7 +11,7 @@ Cura.ActionButton { color: UM.Theme.getColor("secondary_button") textColor: UM.Theme.getColor("secondary_button_text") - outlineColor: UM.Theme.getColor("secondary_button_text") + outlineColor: UM.Theme.getColor("border_accent_1") disabledColor: UM.Theme.getColor("action_button_disabled") textDisabledColor: UM.Theme.getColor("action_button_disabled_text") hoverColor: UM.Theme.getColor("secondary_button_hover") diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 5d90ac93e4..2706992517 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -56,6 +56,8 @@ "main_window_header_background_gradient": "background_4", "main_window_header_button_background_hovered": [46, 46, 46, 255], + "secondary_button_text": "text_secondary_button", + "account_sync_state_icon": [255, 255, 255, 204], "machine_selector_printer_icon": [204, 204, 204, 255], diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 6ba4867b6d..a13cc59c90 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -211,12 +211,11 @@ "icon": [8, 7, 63, 255], - "primary_button": [25, 110, 240, 255], "primary_button": "accent_1", "primary_button_hover": [16, 70, 156, 255], "primary_button_text": [255, 255, 255, 255], - "secondary_button": "text_default", + "secondary_button": "background_1", "secondary_button_shadow": [216, 216, 216, 255], "secondary_button_hover": [232, 240, 253, 255], "secondary_button_text": "accent_1", From 14b0f66c995f9c4dcdbdbcae0944076ed3b72847 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:14:23 +0100 Subject: [PATCH 02/14] Remove hardcoded value for visibility preset selector CURA-8688 --- resources/qml/Preferences/SettingVisibilityPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index 0cc10be0f9..bdb252f3c2 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -105,7 +105,7 @@ UM.PreferencesPage Cura.ComboBox { id: visibilityPreset - width: 150 * screenScaleFactor + width: UM.Theme.getSize("action_button").width anchors { top: parent.top From 6713056a49630588578a9ba69adb946635f688f8 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:15:39 +0100 Subject: [PATCH 03/14] Ensure that setting visibility filter is styled CURA-8688 --- resources/qml/Preferences/SettingVisibilityPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/SettingVisibilityPage.qml b/resources/qml/Preferences/SettingVisibilityPage.qml index bdb252f3c2..1e2ab6a365 100644 --- a/resources/qml/Preferences/SettingVisibilityPage.qml +++ b/resources/qml/Preferences/SettingVisibilityPage.qml @@ -84,7 +84,7 @@ UM.PreferencesPage } } - TextField + Cura.TextField { id: filter From c6e2561dbb418a3ad8cb82740740858bdbd45244 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:19:56 +0100 Subject: [PATCH 04/14] Fix styling for Machine Settings CURA-8688 --- plugins/MachineSettingsAction/MachineSettingsAction.qml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/MachineSettingsAction/MachineSettingsAction.qml b/plugins/MachineSettingsAction/MachineSettingsAction.qml index 0f0ffac8cd..7f72fea4c3 100644 --- a/plugins/MachineSettingsAction/MachineSettingsAction.qml +++ b/plugins/MachineSettingsAction/MachineSettingsAction.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 @@ -88,7 +88,7 @@ Cura.MachineAction } } - Label + UM.Label { id: machineNameLabel anchors.top: parent.top @@ -97,7 +97,6 @@ Cura.MachineAction text: Cura.MachineManager.activeMachine.name horizontalAlignment: Text.AlignHCenter font: UM.Theme.getFont("large_bold") - renderType: Text.NativeRendering } UM.TabRow From f7852e4f9daba87faec0af5e73c966c84b34b88f Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:22:19 +0100 Subject: [PATCH 05/14] Use correct menu type for setting contet menu CURA-8688 --- resources/qml/Settings/SettingView.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Settings/SettingView.qml b/resources/qml/Settings/SettingView.qml index 48c658e4e7..2ab98081e7 100644 --- a/resources/qml/Settings/SettingView.qml +++ b/resources/qml/Settings/SettingView.qml @@ -409,7 +409,7 @@ Item } } - Menu + Cura.Menu { id: contextMenu From 1f39a1b87fe9062fed0726a1c68c15359298d7d7 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:30:14 +0100 Subject: [PATCH 06/14] Add CuraStyled rename dialog CURA-8688 --- resources/qml/Preferences/ProfilesPage.qml | 6 +- resources/qml/Preferences/RenameDialog.qml | 91 ++++++++++++++++++++++ resources/qml/qmldir | 1 + 3 files changed, 95 insertions(+), 3 deletions(-) create mode 100644 resources/qml/Preferences/RenameDialog.qml diff --git a/resources/qml/Preferences/ProfilesPage.qml b/resources/qml/Preferences/ProfilesPage.qml index 1ee86f9f0c..d6522829fe 100644 --- a/resources/qml/Preferences/ProfilesPage.qml +++ b/resources/qml/Preferences/ProfilesPage.qml @@ -144,7 +144,7 @@ UM.ManagementPage } // Dialog to request a name when creating a new profile - UM.RenameDialog + Cura.RenameDialog { id: createQualityDialog title: catalog.i18nc("@title:window", "Create Profile") @@ -233,7 +233,7 @@ UM.ManagementPage } // Dialog to request a name when duplicating a new profile - UM.RenameDialog + Cura.RenameDialog { id: duplicateQualityDialog title: catalog.i18nc("@title:window", "Duplicate Profile") @@ -263,7 +263,7 @@ UM.ManagementPage } // Dialog to rename a quality profile - UM.RenameDialog + Cura.RenameDialog { id: renameQualityDialog title: catalog.i18nc("@title:window", "Rename Profile") diff --git a/resources/qml/Preferences/RenameDialog.qml b/resources/qml/Preferences/RenameDialog.qml new file mode 100644 index 0000000000..7bf02e92a1 --- /dev/null +++ b/resources/qml/Preferences/RenameDialog.qml @@ -0,0 +1,91 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Uranium is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.1 +import QtQuick.Controls 2.0 +import QtQuick.Window 2.1 + +import UM 1.5 as UM +import Cura 1.0 as Cura + +UM.Dialog +{ + id: base + property string object: "" + + property alias newName: nameField.text + property bool validName: true + property string validationError + property string dialogTitle: catalog.i18nc("@title:window", "Rename") + property string explanation: catalog.i18nc("@info", "Please provide a new name.") + + title: dialogTitle + + minimumWidth: UM.Theme.getSize("small_popup_dialog").width + minimumHeight: UM.Theme.getSize("small_popup_dialog").height + width: minimumWidth + height: minimumHeight + + property variant catalog: UM.I18nCatalog { name: "cura" } + + signal textChanged(string text) + signal selectText() + onSelectText: + { + nameField.selectAll(); + nameField.focus = true; + } + + Column + { + anchors.fill: parent + + UM.Label + { + text: base.explanation + "\n" //Newline to make some space using system theming. + width: parent.width + wrapMode: Text.WordWrap + } + + Cura.TextField + { + id: nameField + width: parent.width + text: base.object + maximumLength: 40 + selectByMouse: true + onTextChanged: base.textChanged(text) + } + + UM.Label + { + visible: !base.validName + text: base.validationError + } + } + + Item + { + ButtonGroup { + buttons: [cancelButton, okButton] + checkedButton: okButton + } + } + + rightButtons: [ + Cura.SecondaryButton + { + id: cancelButton + text: catalog.i18nc("@action:button","Cancel") + onClicked: base.reject() + }, + Cura.PrimaryButton + { + id: okButton + text: catalog.i18nc("@action:button", "OK") + onClicked: base.accept() + enabled: base.validName + } + ] +} + diff --git a/resources/qml/qmldir b/resources/qml/qmldir index 2d5839f798..8ddacc56e4 100644 --- a/resources/qml/qmldir +++ b/resources/qml/qmldir @@ -47,3 +47,4 @@ GcodeTextArea 1.0 GcodeTextArea.qml NumericTextFieldWithUnit 1.0 NumericTextFieldWithUnit.qml PrintHeadMinMaxTextField 1.0 PrintHeadMinMaxTextField.qml SimpleCheckBox 1.0 SimpleCheckBox.qml +RenameDialog 1.0 RenameDialog.qml From cc29e2398b6502034291e2deca0b6f6b1d15cb56 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:35:56 +0100 Subject: [PATCH 07/14] Set correct text highlight color for TextField CURA-8688 --- resources/qml/Widgets/TextField.qml | 1 + resources/themes/cura-light/theme.json | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Widgets/TextField.qml b/resources/qml/Widgets/TextField.qml index bace79a98a..66894eca69 100644 --- a/resources/qml/Widgets/TextField.qml +++ b/resources/qml/Widgets/TextField.qml @@ -24,6 +24,7 @@ TextField font: UM.Theme.getFont("default") color: UM.Theme.getColor("text") renderType: Text.NativeRendering + selectionColor: UM.Theme.getColor("text_selection") leftPadding: iconLeft.visible ? iconLeft.width + UM.Theme.getSize("default_margin").width * 2 : UM.Theme.getSize("thin_margin").width states: [ diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 6ba4867b6d..e22c02d5d5 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -206,7 +206,6 @@ "text_selection": [156, 195, 255, 127], "border": [127, 127, 127, 255], "border_field": [180, 180, 180, 255], - "text_selection": [156,195, 255, 127], "secondary": [240, 240, 240, 255], "icon": [8, 7, 63, 255], From bb1a2a998831b582e5e02865eaf0e0a79c2507fa Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:46:29 +0100 Subject: [PATCH 08/14] Fix QML warning CURA-8688 --- resources/qml/Preferences/GeneralPage.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index 2b340a7ab5..52e141ad3c 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -14,7 +14,7 @@ UM.PreferencesPage title: catalog.i18nc("@title:tab", "General") id: generalPreferencesPage - width: parent.width + width: parent ? parent.width: 0 function setDefaultLanguage(languageCode) { From ea588d85fb3ab5bc55dd48878162662ef9cb2d55 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:47:27 +0100 Subject: [PATCH 09/14] Remove unneeded anchor from workspace summary dialog CURA-8688 --- resources/qml/Dialogs/WorkspaceSummaryDialog.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml index 00c4fb8f50..c5c7248a98 100644 --- a/resources/qml/Dialogs/WorkspaceSummaryDialog.qml +++ b/resources/qml/Dialogs/WorkspaceSummaryDialog.qml @@ -272,7 +272,6 @@ UM.Dialog UM.CheckBox { id: dontShowAgainCheckbox - anchors.left: parent.left text: catalog.i18nc("@action:label", "Don't show project summary on save again") checked: dontShowAgain } From 79ee9ffc917a975f95aab5b8a683fa564be08a14 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 13:48:30 +0100 Subject: [PATCH 10/14] Fix warning spam in MainWindowHeader CURA-8688 --- resources/qml/MainWindow/MainWindowHeader.qml | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index c38e1bb4ab..3f22879992 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -78,7 +78,6 @@ Item background: Rectangle { radius: UM.Theme.getSize("action_button_radius").width - width: contents.width color: { if (stageSelectorButton.checked) From 62f6643a49c65a1b03f139fb7bcc0b1d1c09e611 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 14:08:26 +0100 Subject: [PATCH 11/14] Add checkbox disabled color to darktheme CURA-8688 --- resources/themes/cura-dark/theme.json | 1 + resources/themes/cura-light/theme.json | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 5d90ac93e4..55dc777fd7 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -159,6 +159,7 @@ "checkbox_mark": "text_default", "checkbox_square": "text_disabled", "checkbox_text": "text_default", + "checkbox_disabled": "background_2", "tooltip": "background_2", "tooltip_text": "text_default", diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index e22c02d5d5..9504ed6300 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -327,7 +327,7 @@ "checkbox_border": [180, 180, 180, 255], "checkbox_border_hover": [25, 110, 240, 255], "checkbox_mark": [35, 35, 35, 255], - "checkbox_disabled": [223, 223, 223, 255], + "checkbox_disabled": "background_2", "checkbox_text": [0, 12, 26, 255], "tooltip": [25, 25, 25, 255], From ce86e025d9e7b4f2017f1a0ccd775e1dc81869ae Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Mon, 28 Feb 2022 14:56:07 +0100 Subject: [PATCH 12/14] New style highlighting on borders CURA-8688 --- resources/qml/Widgets/ComboBox.qml | 9 +++------ resources/qml/Widgets/RadioButton.qml | 2 +- resources/qml/Widgets/TextField.qml | 1 + resources/themes/cura-dark/theme.json | 2 +- resources/themes/cura-light/theme.json | 7 +++++-- 5 files changed, 11 insertions(+), 10 deletions(-) diff --git a/resources/qml/Widgets/ComboBox.qml b/resources/qml/Widgets/ComboBox.qml index 121c5f15da..a9e48e5a60 100644 --- a/resources/qml/Widgets/ComboBox.qml +++ b/resources/qml/Widgets/ComboBox.qml @@ -26,21 +26,18 @@ ComboBox { name: "disabled" when: !control.enabled - PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_disabled")} + PropertyChanges { target: background; color: UM.Theme.getColor("setting_control_disabled")} PropertyChanges { target: contentLabel; color: UM.Theme.getColor("setting_control_disabled_text")} }, State { name: "highlighted" when: control.hovered || control.activeFocus - PropertyChanges { target: backgroundRectangle; color: UM.Theme.getColor("setting_control_highlight")} + PropertyChanges { target: background; liningColor: UM.Theme.getColor("border_main_light")} } ] - background: UM.UnderlineBackground - { - id: backgroundRectangle - } + background: UM.UnderlineBackground{} indicator: UM.RecolorImage { diff --git a/resources/qml/Widgets/RadioButton.qml b/resources/qml/Widgets/RadioButton.qml index 96c2d95f56..428eb8a4e5 100644 --- a/resources/qml/Widgets/RadioButton.qml +++ b/resources/qml/Widgets/RadioButton.qml @@ -38,7 +38,7 @@ RadioButton { name: "highlighted" when: radioButton.hovered || radioButton.activeFocus - PropertyChanges { target: indicator; border.color: UM.Theme.getColor("accent_1")} + PropertyChanges { target: indicator; border.color: UM.Theme.getColor("border_main_light")} } ] diff --git a/resources/qml/Widgets/TextField.qml b/resources/qml/Widgets/TextField.qml index bace79a98a..959506ff2b 100644 --- a/resources/qml/Widgets/TextField.qml +++ b/resources/qml/Widgets/TextField.qml @@ -43,6 +43,7 @@ TextField { name: "hovered" when: textField.hovered || textField.activeFocus + PropertyChanges { target: backgroundRectangle; liningColor: UM.Theme.getColor("border_main_light")} } ] diff --git a/resources/themes/cura-dark/theme.json b/resources/themes/cura-dark/theme.json index 2706992517..fe18818d99 100644 --- a/resources/themes/cura-dark/theme.json +++ b/resources/themes/cura-dark/theme.json @@ -157,7 +157,7 @@ "checkbox": "background_1", "checkbox_hover": [43, 48, 52, 255], "checkbox_border": "text_disabled", - "checkbox_border_hover": [255, 255, 255, 38], + "checkbox_border_hover": "border_main", "checkbox_mark": "text_default", "checkbox_square": "text_disabled", "checkbox_text": "text_default", diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index a13cc59c90..9c6e043eee 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -323,7 +323,7 @@ "quality_slider_available": [0, 0, 0, 255], "checkbox": [255, 255, 255, 255], - "checkbox_hover": [255, 255, 255, 255], + "checkbox_hover": "border_main", "checkbox_border": [180, 180, 180, 255], "checkbox_border_hover": [25, 110, 240, 255], "checkbox_mark": [35, 35, 35, 255], @@ -423,7 +423,10 @@ "cloud_unavailable": [153, 153, 153, 255], "connection_badge_background": [255, 255, 255, 255], "warning_badge_background": [0, 0, 0, 255], - "error_badge_background": [255, 255, 255, 255] + "error_badge_background": [255, 255, 255, 255], + + "border_field_light": [180, 180, 180, 255], + "border_main_light": [212, 212, 212, 255] }, "sizes": { From 5725f3d57fb82c63c629147bce26a6198a6312ff Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 15:46:04 +0100 Subject: [PATCH 13/14] Fix height of syncMaterialCards CURA-8688 --- resources/qml/Preferences/Materials/MaterialsSyncDialog.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml index 0360e2c94b..e592be6d5d 100644 --- a/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml +++ b/resources/qml/Preferences/Materials/MaterialsSyncDialog.qml @@ -266,7 +266,7 @@ Window border.color: UM.Theme.getColor("lining") border.width: UM.Theme.getSize("default_lining").width width: printerList.width - printerListScrollBar.width - height: UM.Theme.getSize("card").height + height: UM.Theme.getSize("machine_selector_icon").height + 2 * UM.Theme.getSize("default_margin").height property string syncStatus: { From 38b947f0fb17c3389618ea9f16de84fe03d00603 Mon Sep 17 00:00:00 2001 From: Jaime van Kessel Date: Mon, 28 Feb 2022 15:57:36 +0100 Subject: [PATCH 14/14] Fix width in multiply dialog CURA-8688 --- resources/qml/Menus/ContextMenu.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/qml/Menus/ContextMenu.qml b/resources/qml/Menus/ContextMenu.qml index f25b3f70e5..1bba79e2c1 100644 --- a/resources/qml/Menus/ContextMenu.qml +++ b/resources/qml/Menus/ContextMenu.qml @@ -133,6 +133,7 @@ Cura.Menu focus: true from: 1 to: 99 + width: 2 * UM.Theme.getSize("button").width } } }