From 7d8fdf8bdd63116aa890bec03e95463f66205ad4 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 16 Jun 2022 13:12:36 +0200 Subject: [PATCH 1/8] Items in intent selection settings column were not filling width, the result of this was any item with more than one child would have these children squished together. Fix is to have the children fill their width CURA-8849 --- .../PrintSetupSelector/Recommended/RecommendedPrintSetup.qml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml index aac8dcecfb..8feadc4f88 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml @@ -54,6 +54,7 @@ Item { width: parent.width visible: !recommendedResolutionSelector.visible + Layout.fillWidth: true } @@ -95,6 +96,7 @@ Item width: parent.width // TODO Create a reusable component with these properties to not define them separately for each component labelColumnWidth: parent.firstColumnWidth + Layout.fillWidth: true Layout.leftMargin: UM.Theme.getSize("default_margin").width } @@ -103,6 +105,7 @@ Item width: parent.width // TODO Create a reusable component with these properties to not define them separately for each component labelColumnWidth: parent.firstColumnWidth + Layout.fillWidth: true Layout.leftMargin: UM.Theme.getSize("default_margin").width } } From 1e5f6bce7243da3825ab5489bd6db1f411a1d712 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 16 Jun 2022 13:23:50 +0200 Subject: [PATCH 2/8] Increase margins on warning to match design CURA-8849 --- .../PrintSetupSelector/Recommended/ProfileWarningReset.qml | 5 +---- .../PrintSetupSelector/Recommended/RecommendedPrintSetup.qml | 2 ++ 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/resources/qml/PrintSetupSelector/Recommended/ProfileWarningReset.qml b/resources/qml/PrintSetupSelector/Recommended/ProfileWarningReset.qml index c9abcab1c8..af4ec45ac2 100644 --- a/resources/qml/PrintSetupSelector/Recommended/ProfileWarningReset.qml +++ b/resources/qml/PrintSetupSelector/Recommended/ProfileWarningReset.qml @@ -3,13 +3,10 @@ import QtQuick 2.10 import UM 1.6 as UM import Cura 1.6 as Cura -Rectangle +Item { height: visible ? UM.Theme.getSize("action_button_icon").height : 0 visible: Cura.SimpleModeSettingsManager.isProfileCustomized || Cura.MachineManager.hasCustomQuality - anchors.topMargin: UM.Theme.getSize("default_margin") - anchors.bottomMargin: UM.Theme.getSize("default_margin") - Rectangle { diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml index 8feadc4f88..30fe571b7a 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml @@ -62,6 +62,8 @@ Item { width: parent.width Layout.fillWidth: true + Layout.topMargin: UM.Theme.getSize("thin_margin").height + Layout.bottomMargin: UM.Theme.getSize("thin_margin").height } //Line between the sections. From 689547f125ba612dc47a7bfd5f9d779e0df4b7b8 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 16 Jun 2022 13:49:30 +0200 Subject: [PATCH 3/8] We are using recommendedResolutionSelector._previousResolution to see if the resolution had changed before highlighting the resolution selector. This updates when intents change but not when qualities change. I tried updating when the qualities change but this was updating before this line if(recommendedResolutionSelector._previousResolution !== Cura.MachineManager.activeQualityType) which caused this always to resolve as true The solution was to update _previousResolution after we select an item in the drop down. CURA-8849 --- .../Recommended/RecommendedResolutionSelector.qml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedResolutionSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedResolutionSelector.qml index 6217cfe1cc..bbad686514 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedResolutionSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedResolutionSelector.qml @@ -66,6 +66,11 @@ Item { var selected_item = model.getItem(currentIndex) Cura.IntentManager.selectIntent(selected_item.intent_category, selected_item.quality_type) + + if (Cura.IntentManager.currentIntentCategory == selected_item.intent_category) + { + recommendedResolutionSelector._previousResolution = selected_item.quality_type; + } } Connections From 1e0236e317bb092352482b6469893682911a8ce7 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 16 Jun 2022 13:56:46 +0200 Subject: [PATCH 4/8] Remove left margins which don't align with the intended design. CURA-8849 --- .../PrintSetupSelector/Recommended/RecommendedPrintSetup.qml | 3 --- 1 file changed, 3 deletions(-) diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml index 30fe571b7a..59ac5dc1a9 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml @@ -89,7 +89,6 @@ Item // TODO Create a reusable component with these properties to not define them separately for each component labelColumnWidth: parent.firstColumnWidth Layout.fillWidth: true - Layout.leftMargin: UM.Theme.getSize("default_margin").width Layout.rightMargin: UM.Theme.getSize("default_margin").width } @@ -99,7 +98,6 @@ Item // TODO Create a reusable component with these properties to not define them separately for each component labelColumnWidth: parent.firstColumnWidth Layout.fillWidth: true - Layout.leftMargin: UM.Theme.getSize("default_margin").width } RecommendedAdhesionSelector @@ -108,7 +106,6 @@ Item // TODO Create a reusable component with these properties to not define them separately for each component labelColumnWidth: parent.firstColumnWidth Layout.fillWidth: true - Layout.leftMargin: UM.Theme.getSize("default_margin").width } } From 0fb2b466772417382301668c45c57f27dd2a7a51 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 16 Jun 2022 14:05:39 +0200 Subject: [PATCH 5/8] Intent button was showing when only a single intent is available. This was caused by visible being overridden. CURA-8849 --- .../PrintSetupSelector/Recommended/RecommendedPrintSetup.qml | 2 +- .../Recommended/RecommendedQualityProfileSelector.qml | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml index 59ac5dc1a9..d4fd28cdd5 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml @@ -40,7 +40,7 @@ Item RecommendedQualityProfileSelector { width: parent.width - visible: recommendedResolutionSelector.visible + hasQualityOptions: recommendedResolutionSelector.visible } RecommendedResolutionSelector diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml index 6bcca955d1..87cb271ed4 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedQualityProfileSelector.qml @@ -12,8 +12,11 @@ import ".." Item { id: qualityRow + + property bool hasQualityOptions: true + height: childrenRect.height - visible: intentSelectionRepeater.count > 1 //Only show selector if there's more options than just "default". + visible: intentSelectionRepeater.count > 1 && hasQualityOptions //Only show selector if there's more options than just "default". RowLayout { From cc58b362fcac2bb3298791cf66747ad82e85b8d2 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 16 Jun 2022 14:19:39 +0200 Subject: [PATCH 6/8] Add text wrapping for very long custom profile names. CURA-8849 --- .../qml/PrintSetupSelector/Recommended/ProfileWarningReset.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/resources/qml/PrintSetupSelector/Recommended/ProfileWarningReset.qml b/resources/qml/PrintSetupSelector/Recommended/ProfileWarningReset.qml index af4ec45ac2..1a54dc27db 100644 --- a/resources/qml/PrintSetupSelector/Recommended/ProfileWarningReset.qml +++ b/resources/qml/PrintSetupSelector/Recommended/ProfileWarningReset.qml @@ -31,6 +31,7 @@ Item UM.Label { id: warning + width: parent.width - warningIcon.width - resetToDefaultQualityButton.width anchors { left: warningIcon.right @@ -38,7 +39,7 @@ Item leftMargin: UM.Theme.getSize("thin_margin").width } - text: "" + wrapMode: Text.WordWrap states: [ State From 1a464051d45367e80f845b30d21ad51ba12fe112 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 16 Jun 2022 14:27:13 +0200 Subject: [PATCH 7/8] On initial startup, when assigning your first printer the ActiveIntentQualitiesModel.py would not be updated. Causing an error unsupported configuration to show. Fixed by updating the model when the globalContainer is changed as well. CURA-8849 --- cura/Machines/Models/ActiveIntentQualitiesModel.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cura/Machines/Models/ActiveIntentQualitiesModel.py b/cura/Machines/Models/ActiveIntentQualitiesModel.py index 769f9410c5..3f03e9c683 100644 --- a/cura/Machines/Models/ActiveIntentQualitiesModel.py +++ b/cura/Machines/Models/ActiveIntentQualitiesModel.py @@ -36,6 +36,8 @@ class ActiveIntentQualitiesModel(ListModel): IntentManager.intentCategoryChangedSignal.connect(self._update) machine_manager = cura.CuraApplication.CuraApplication.getInstance().getMachineManager() machine_manager.activeQualityGroupChanged.connect(self._update) + machine_manager.globalContainerChanged.connect(self._updateDelayed) + machine_manager.extruderChanged.connect(self._updateDelayed) # We also need to update if an extruder gets disabled self._update_timer = QTimer() self._update_timer.setInterval(100) @@ -52,6 +54,7 @@ class ActiveIntentQualitiesModel(ListModel): self._updateDelayed() def _update(self): + print("Updating") active_extruder_stack = cura.CuraApplication.CuraApplication.getInstance().getMachineManager().activeStack if active_extruder_stack: self._intent_category = active_extruder_stack.intent.getMetaDataEntry("intent_category", "") From 9dff733345170d81d9bfad6af0db2b893492c818 Mon Sep 17 00:00:00 2001 From: "j.delarago" Date: Thu, 16 Jun 2022 15:32:33 +0200 Subject: [PATCH 8/8] Remove todos that are no longer applicable Remove debug print statement CURA-9321 --- cura/Machines/Models/ActiveIntentQualitiesModel.py | 1 - .../PrintSetupSelector/Recommended/RecommendedPrintSetup.qml | 3 --- 2 files changed, 4 deletions(-) diff --git a/cura/Machines/Models/ActiveIntentQualitiesModel.py b/cura/Machines/Models/ActiveIntentQualitiesModel.py index 3f03e9c683..2e13f7dbcb 100644 --- a/cura/Machines/Models/ActiveIntentQualitiesModel.py +++ b/cura/Machines/Models/ActiveIntentQualitiesModel.py @@ -54,7 +54,6 @@ class ActiveIntentQualitiesModel(ListModel): self._updateDelayed() def _update(self): - print("Updating") active_extruder_stack = cura.CuraApplication.CuraApplication.getInstance().getMachineManager().activeStack if active_extruder_stack: self._intent_category = active_extruder_stack.intent.getMetaDataEntry("intent_category", "") diff --git a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml index d4fd28cdd5..086e27d41b 100644 --- a/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml +++ b/resources/qml/PrintSetupSelector/Recommended/RecommendedPrintSetup.qml @@ -86,7 +86,6 @@ Item RecommendedInfillDensitySelector { width: parent.width - // TODO Create a reusable component with these properties to not define them separately for each component labelColumnWidth: parent.firstColumnWidth Layout.fillWidth: true Layout.rightMargin: UM.Theme.getSize("default_margin").width @@ -95,7 +94,6 @@ Item RecommendedSupportSelector { width: parent.width - // TODO Create a reusable component with these properties to not define them separately for each component labelColumnWidth: parent.firstColumnWidth Layout.fillWidth: true } @@ -103,7 +101,6 @@ Item RecommendedAdhesionSelector { width: parent.width - // TODO Create a reusable component with these properties to not define them separately for each component labelColumnWidth: parent.firstColumnWidth Layout.fillWidth: true }