Просмотр исходного кода

Apply suggestions from code review

Jelle Spijker 2 лет назад
Родитель
Сommit
91170e0aef

+ 1 - 1
resources/qml/PrintSetupSelector/Recommended/RecommendedSupportSelector.qml

@@ -1,4 +1,4 @@
-// Copyright (c) 2022 UltiMaker B.V.
+// Copyright (c) 2022 UltiMaker
 // Cura is released under the terms of the LGPLv3 or higher.
 
 import QtQuick 2.10

+ 2 - 1
resources/qml/Widgets/SingleSettingComboBox.qml

@@ -22,7 +22,8 @@ Cura.ComboBox {
     // This is only used if updateAllExtruders == true
     property int defaultExtruderIndex: 0
 
-    model:  ListModel {
+    model:  ListModel
+    {
         id: comboboxModel
 
         // The propertyProvider has not loaded the setting when this components onComplete triggers. Populating the model

+ 8 - 2
resources/qml/Widgets/SingleSettingSlider.qml

@@ -62,8 +62,14 @@ RowLayout
     Connections
     {
         target: propertyProvider
-        function onContainerStackChanged() { updateTimer.restart() }
-        function onIsValueUsedChanged() { updateTimer.restart() }
+        function onContainerStackChanged()
+        {
+            comboboxModel.updateModel()
+        }
+        function onIsValueUsedChanged()
+        {
+            comboboxModel.updateModel()
+        }
     }
 
     // Updates to the setting are delayed by interval. This reduces lag by waiting a bit after a setting change to update the slider contents.

+ 8 - 2
resources/qml/Widgets/SingleSettingTextField.qml

@@ -59,8 +59,14 @@ UM.TextField
     Connections
     {
         target: propertyProvider
-        function onContainerStackChanged() { updateTimer.restart() }
-        function onIsValueUsedChanged() { updateTimer.restart() }
+        function onContainerStackChanged()
+        {
+            updateTimer.restart()
+        }
+        function onIsValueUsedChanged()
+        {
+            updateTimer.restart()
+        }
     }
 
     // Restart update timer right after releasing a key. This stops lag while typing, but you still get warning and error