From 8ee0e13394492ce889e9eb7c08a5e30616a94cfc Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 9 Apr 2021 15:12:28 +0200 Subject: [PATCH 1/3] Remove hack that made older code work to make newer code work. Theme and Language (in the interface) would stay on 'Colorblind Assist' and empty respectively, even if the actual theme (and obvioulsy the language) where different. CURA-8161 --- resources/qml/Preferences/GeneralPage.qml | 29 ----------------------- 1 file changed, 29 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index f17fa9c05f..e6872170d1 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -197,20 +197,6 @@ UM.PreferencesPage } } onActivated: UM.Preferences.setValue("general/language", model.get(index).code) - - Component.onCompleted: - { - // Because ListModel is stupid and does not allow using qsTr() for values. - for(var i = 0; i < languageList.count; ++i) - { - languageList.setProperty(i, "text", catalog.i18n(languageList.get(i).text)); - } - - // Glorious hack time. ComboBox does not update the text properly after changing the - // model. So change the indices around to force it to update. - currentIndex += 1; - currentIndex -= 1; - } } Label @@ -265,21 +251,6 @@ UM.PreferencesPage return 0; } onActivated: UM.Preferences.setValue("general/theme", model.get(index).code) - - Component.onCompleted: - { - // Because ListModel is stupid and does not allow using qsTr() for values. - for(var i = 0; i < themeList.count; ++i) - { - themeList.setProperty(i, "text", catalog.i18n(themeList.get(i).text)); - } - - // Glorious hack time. ComboBox does not update the text properly after changing the - // model. So change the indices around to force it to update. - currentIndex += 1; - currentIndex -= 1; - } - } } From ed7439f9cdf99debd56b763d7379f80ff00aa67d Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Fri, 9 Apr 2021 15:30:09 +0200 Subject: [PATCH 2/3] Fix various UX issues. - Remove donkey: We where showing our donkey due to an unfortunate abbreviation/truncation of 'Colorblind Assist'. Now that should already not show in for a default install, which was fixed in the previous commit, but also just give the box some more space. - Revert most of the rest of the preferences/general page back to the old controls (except for the combo-boxes, which needed to be upgraded in order to work on MacOS 11), pending a _proper_ redesign to the newer style of this page. CURA-8161 --- resources/qml/Preferences/GeneralPage.qml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index e6872170d1..ca02d9a125 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -2,10 +2,12 @@ // Cura is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 2.3 +import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 import QtQuick.Controls.Styles 1.1 +import QtQuick.Controls 2.3 as NewControls + import UM 1.1 as UM import Cura 1.1 as Cura @@ -139,6 +141,7 @@ UM.PreferencesPage { id: interfaceGrid columns: 4 + width: parent.width Label { @@ -178,12 +181,13 @@ UM.PreferencesPage } } - ComboBox + NewControls.ComboBox { id: languageComboBox textRole: "text" model: languageList + Layout.fillWidth: true currentIndex: { @@ -231,12 +235,13 @@ UM.PreferencesPage } } - ComboBox + NewControls.ComboBox { id: themeComboBox model: themeList textRole: "text" + Layout.fillWidth: true currentIndex: { @@ -506,7 +511,7 @@ UM.PreferencesPage } } - ComboBox + NewControls.ComboBox { id: cameraComboBox @@ -647,7 +652,7 @@ UM.PreferencesPage text: catalog.i18nc("@window:text", "Default behavior when opening a project file: ") } - ComboBox + NewControls.ComboBox { id: choiceOnOpenProjectDropDownButton width: 200 * screenScaleFactor @@ -714,7 +719,7 @@ UM.PreferencesPage text: catalog.i18nc("@window:text", "Default behavior for changed setting values when switching to a different profile: ") } - ComboBox + NewControls.ComboBox { id: choiceOnProfileOverrideDropDownButton width: 200 * screenScaleFactor From 97442ebefc40c161fc55e5b4adbfb54bcb6124c6 Mon Sep 17 00:00:00 2001 From: Kostas Karmas Date: Fri, 9 Apr 2021 16:18:04 +0200 Subject: [PATCH 3/3] Increase size of the profile override choice popup in preferences This way the popup will show the entire text for all three options. CURA-8161 --- resources/qml/Preferences/GeneralPage.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/qml/Preferences/GeneralPage.qml b/resources/qml/Preferences/GeneralPage.qml index ca02d9a125..cdf0636144 100644 --- a/resources/qml/Preferences/GeneralPage.qml +++ b/resources/qml/Preferences/GeneralPage.qml @@ -655,7 +655,7 @@ UM.PreferencesPage NewControls.ComboBox { id: choiceOnOpenProjectDropDownButton - width: 200 * screenScaleFactor + width: Math.round(250 * screenScaleFactor) model: ListModel { @@ -722,8 +722,8 @@ UM.PreferencesPage NewControls.ComboBox { id: choiceOnProfileOverrideDropDownButton - width: 200 * screenScaleFactor - + width: Math.round(250 * screenScaleFactor) + popup.width: Math.round(350 * screenScaleFactor) model: ListModel { id: discardOrKeepProfileListModel