Browse Source

Merge pull request #11342 from Ultimaker/CURA-8686_views_controls2

Update views and tabs to use Controls 2
Remco Burema 3 years ago
parent
commit
b96f58799c

+ 10 - 2
cura/Machines/Models/QualitySettingsModel.py

@@ -1,4 +1,4 @@
-# Copyright (c) 2020 Ultimaker B.V.
+# Copyright (c) 2022 Ultimaker B.V.
 # Cura is released under the terms of the LGPLv3 or higher.
 
 from PyQt5.QtCore import pyqtProperty, pyqtSignal, Qt
@@ -9,6 +9,7 @@ from UM import i18nCatalog
 from UM.Logger import Logger
 from UM.Qt.ListModel import ListModel
 from UM.Settings.ContainerRegistry import ContainerRegistry
+from UM.Settings.SettingFunction import SettingFunction  # To format setting functions differently.
 
 import os
 
@@ -173,12 +174,19 @@ class QualitySettingsModel(ListModel):
             label = definition.label
             if self._i18n_catalog:
                 label = self._i18n_catalog.i18nc(definition.key + " label", label)
+            if profile_value_source == "quality_changes":
+                label = f"<i>{label}</i>"  # Make setting name italic if it's derived from the quality-changes profile.
+
+            if isinstance(profile_value, SettingFunction):
+                profile_value_display = self._i18n_catalog.i18nc("@info:status", "Calculated")
+            else:
+                profile_value_display = "" if profile_value is None else str(profile_value)
 
             items.append({
                 "key": definition.key,
                 "label": label,
                 "unit": definition.unit,
-                "profile_value": "" if profile_value is None else str(profile_value),  # it is for display only
+                "profile_value": profile_value_display,
                 "profile_value_source": profile_value_source,
                 "user_value": "" if user_value is None else str(user_value),
                 "category": current_category

+ 19 - 24
plugins/CuraDrive/src/qml/components/BackupList.qml

@@ -1,39 +1,34 @@
-// Copyright (c) 2018 Ultimaker B.V.
+// Copyright (c) 2022 Ultimaker B.V.
 // Cura is released under the terms of the LGPLv3 or higher.
 
 import QtQuick 2.7
 import QtQuick.Controls 2.2
 import QtQuick.Layouts 1.3
 
-import UM 1.1 as UM
+import UM 1.5 as UM
 
-ScrollView
+ListView
 {
-    property alias model: backupList.model
-    width: parent.width
     clip: true
-    ListView
+    ScrollBar.vertical: UM.ScrollBar {}
+
+    delegate: Item
     {
-        id: backupList
-        width: parent.width
-        delegate: Item
-        {
-            // Add a margin, otherwise the scrollbar is on top of the right most component
-            width: parent.width - UM.Theme.getSize("default_margin").width
-            height: childrenRect.height
+        // Add a margin, otherwise the scrollbar is on top of the right most component
+        width: parent.width - UM.Theme.getSize("scrollbar").width
+        height: childrenRect.height
 
-            BackupListItem
-            {
-                id: backupListItem
-                width: parent.width
-            }
+        BackupListItem
+        {
+            id: backupListItem
+            width: parent.width
+        }
 
-            Rectangle
-            {
-                id: divider
-                color: UM.Theme.getColor("lining")
-                height: UM.Theme.getSize("default_lining").height
-            }
+        Rectangle
+        {
+            id: divider
+            color: UM.Theme.getColor("lining")
+            height: UM.Theme.getSize("default_lining").height
         }
     }
 }

+ 20 - 40
plugins/DigitalLibrary/resources/qml/OpenProjectFilesPage.qml

@@ -1,8 +1,9 @@
-// Copyright (C) 2021 Ultimaker B.V.
+//Copyright (C) 2022 Ultimaker B.V.
+//Cura is released under the terms of the LGPLv3 or higher.
 
-import QtQuick 2.10
+import Qt.labs.qmlmodels 1.0
+import QtQuick 2.15
 import QtQuick.Window 2.2
-import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
 import QtQuick.Controls 2.3
 
 import UM 1.2 as UM
@@ -56,51 +57,31 @@ Item
         border.width: UM.Theme.getSize("default_lining").width
         border.color: UM.Theme.getColor("lining")
 
-
-        Cura.TableView
+        //We can't use Cura's TableView here, since in Cura >= 5.0 this uses QtQuick.TableView, while in Cura < 5.0 this uses QtControls1.TableView.
+        //So we have to define our own. Once support for 4.13 and earlier is dropped, we can switch to Cura.TableView.
+        Table
         {
             id: filesTableView
             anchors.fill: parent
-            model: manager.digitalFactoryFileModel
-            visible: model.count != 0 && manager.retrievingFileStatus != DF.RetrievalStatus.InProgress
-            selectionMode: OldControls.SelectionMode.SingleSelection
-            onDoubleClicked:
-            {
-                manager.setSelectedFileIndices([row]);
-                openFilesButton.clicked();
-            }
-
-            OldControls.TableViewColumn
-            {
-                id: fileNameColumn
-                role: "fileName"
-                title: "Name"
-                width: Math.round(filesTableView.width / 3)
-            }
+            anchors.margins: parent.border.width
 
-            OldControls.TableViewColumn
+            columnHeaders: ["Name", "Uploaded by", "Uploaded at"]
+            model: TableModel
             {
-                id: usernameColumn
-                role: "username"
-                title: "Uploaded by"
-                width: Math.round(filesTableView.width / 3)
+                TableModelColumn { display: "fileName" }
+                TableModelColumn { display: "username" }
+                TableModelColumn { display: "uploadedAt" }
+                rows: manager.digitalFactoryFileModel.items
             }
 
-            OldControls.TableViewColumn
+            onCurrentRowChanged:
             {
-                role: "uploadedAt"
-                title: "Uploaded at"
+                manager.setSelectedFileIndices([currentRow]);
             }
-
-            Connections
+            onDoubleClicked: function(row)
             {
-                target: filesTableView.selection
-                function onSelectionChanged()
-                {
-                    let newSelection = [];
-                    filesTableView.selection.forEach(function(rowIndex) { newSelection.push(rowIndex); });
-                    manager.setSelectedFileIndices(newSelection);
-                }
+                manager.setSelectedFileIndices([row]);
+                openFilesButton.clicked();
             }
         }
 
@@ -160,7 +141,6 @@ Item
             {
                 // Make sure no files are selected when the file model changes
                 filesTableView.currentRow = -1
-                filesTableView.selection.clear()
             }
         }
     }
@@ -186,7 +166,7 @@ Item
         anchors.bottom: parent.bottom
         anchors.right: parent.right
         text: "Open"
-        enabled: filesTableView.selection.count > 0
+        enabled: filesTableView.currentRow >= 0
         onClicked:
         {
             manager.openSelectedFiles()

+ 15 - 28
plugins/DigitalLibrary/resources/qml/SaveProjectFilesPage.qml

@@ -1,8 +1,9 @@
-// Copyright (C) 2021 Ultimaker B.V.
+//Copyright (C) 2022 Ultimaker B.V.
+//Cura is released under the terms of the LGPLv3 or higher.
 
+import Qt.labs.qmlmodels 1.0
 import QtQuick 2.10
 import QtQuick.Window 2.2
-import QtQuick.Controls 1.4 as OldControls // TableView doesn't exist in the QtQuick Controls 2.x in 5.10, so use the old one
 import QtQuick.Controls 2.3
 
 import UM 1.2 as UM
@@ -85,35 +86,22 @@ Item
         border.width: UM.Theme.getSize("default_lining").width
         border.color: UM.Theme.getColor("lining")
 
-
-        Cura.TableView
+        //We can't use Cura's TableView here, since in Cura >= 5.0 this uses QtQuick.TableView, while in Cura < 5.0 this uses QtControls1.TableView.
+        //So we have to define our own. Once support for 4.13 and earlier is dropped, we can switch to Cura.TableView.
+        Table
         {
             id: filesTableView
             anchors.fill: parent
-            model: manager.digitalFactoryFileModel
-            visible: model.count != 0 && manager.retrievingFileStatus != DF.RetrievalStatus.InProgress
-            selectionMode: OldControls.SelectionMode.NoSelection
-
-            OldControls.TableViewColumn
-            {
-                id: fileNameColumn
-                role: "fileName"
-                title: "@tableViewColumn:title", "Name"
-                width: Math.round(filesTableView.width / 3)
-            }
-
-            OldControls.TableViewColumn
-            {
-                id: usernameColumn
-                role: "username"
-                title: "Uploaded by"
-                width: Math.round(filesTableView.width / 3)
-            }
+            anchors.margins: parent.border.width
 
-            OldControls.TableViewColumn
+            allowSelection: false
+            columnHeaders: ["Name", "Uploaded by", "Uploaded at"]
+            model: TableModel
             {
-                role: "uploadedAt"
-                title: "Uploaded at"
+                TableModelColumn { display: "fileName" }
+                TableModelColumn { display: "username" }
+                TableModelColumn { display: "uploadedAt" }
+                rows: manager.digitalFactoryFileModel.items
             }
         }
 
@@ -172,8 +160,7 @@ Item
             function onItemsChanged()
             {
                 // Make sure no files are selected when the file model changes
-                filesTableView.currentRow = -1
-                filesTableView.selection.clear()
+                filesTableView.currentRow = -1;
             }
         }
     }

+ 200 - 0
plugins/DigitalLibrary/resources/qml/Table.qml

@@ -0,0 +1,200 @@
+//Copyright (C) 2022 Ultimaker B.V.
+//Cura is released under the terms of the LGPLv3 or higher.
+
+import Qt.labs.qmlmodels 1.0
+import QtQuick 2.15
+import QtQuick.Controls 2.15
+
+import UM 1.2 as UM
+
+/*
+ * A re-sizeable table of data.
+ *
+ * This table combines a list of headers with a TableView to show certain roles in a table.
+ * The columns of the table can be resized.
+ * When the table becomes too big, you can scroll through the table. When a column becomes too small, the contents of
+ * the table are elided.
+ * The table gets Cura's themeing.
+ */
+Item
+{
+    id: tableBase
+
+    required property var columnHeaders //The text to show in the headers of each column.
+    property alias model: tableView.model //A TableModel to display in this table. To use a ListModel for the rows, use "rows: listModel.items"
+    property int currentRow: -1 //The selected row index.
+    property var onDoubleClicked: function(row) {} //Something to execute when double clicked. Accepts one argument: The index of the row that was clicked on.
+    property bool allowSelection: true //Whether to allow the user to select items.
+
+    Row
+    {
+        id: headerBar
+        Repeater
+        {
+            id: headerRepeater
+            model: columnHeaders
+            Rectangle
+            {
+                width: Math.max(1, Math.round(tableBase.width / headerRepeater.count))
+                height: UM.Theme.getSize("section").height
+
+                color: UM.Theme.getColor("secondary")
+
+                Label
+                {
+                    id: contentText
+                    anchors.left: parent.left
+                    anchors.leftMargin: UM.Theme.getSize("narrow_margin").width
+                    anchors.right: parent.right
+                    anchors.rightMargin: UM.Theme.getSize("narrow_margin").width
+
+                    text: modelData
+                    font: UM.Theme.getFont("medium_bold")
+                    color: UM.Theme.getColor("text")
+                    elide: Text.ElideRight
+                }
+                Rectangle //Resize handle.
+                {
+                    anchors
+                    {
+                        right: parent.right
+                        top: parent.top
+                        bottom: parent.bottom
+                    }
+                    width: UM.Theme.getSize("thick_lining").width
+
+                    color: UM.Theme.getColor("thick_lining")
+
+                    MouseArea
+                    {
+                        anchors.fill: parent
+
+                        cursorShape: Qt.SizeHorCursor
+                        drag
+                        {
+                            target: parent
+                            axis: Drag.XAxis
+                        }
+                        onMouseXChanged:
+                        {
+                            if(drag.active)
+                            {
+                                let new_width = parent.parent.width + mouseX;
+                                let sum_widths = mouseX;
+                                for(let i = 0; i < headerBar.children.length; ++i)
+                                {
+                                    sum_widths += headerBar.children[i].width;
+                                }
+                                if(sum_widths > tableBase.width)
+                                {
+                                    new_width -= sum_widths - tableBase.width; //Limit the total width to not exceed the view.
+                                }
+                                let width_fraction = new_width / tableBase.width; //Scale with the same fraction along with the total width, if the table is resized.
+                                parent.parent.width = Qt.binding(function() { return tableBase.width * width_fraction });
+                            }
+                        }
+                    }
+                }
+
+                onWidthChanged:
+                {
+                    tableView.forceLayout(); //Rescale table cells underneath as well.
+                }
+            }
+        }
+    }
+
+    TableView
+    {
+        id: tableView
+        anchors
+        {
+            top: headerBar.bottom
+            left: parent.left
+            right: parent.right
+            bottom: parent.bottom
+        }
+
+        clip: true
+        ScrollBar.vertical: ScrollBar
+        {
+            // Vertical ScrollBar, styled similarly to the scrollBar in the settings panel
+            id: verticalScrollBar
+            visible: tableView.contentHeight > tableView.height
+
+            background: Rectangle
+            {
+                implicitWidth: UM.Theme.getSize("scrollbar").width
+                radius: Math.round(implicitWidth / 2)
+                color: UM.Theme.getColor("scrollbar_background")
+            }
+
+            contentItem: Rectangle
+            {
+                id: scrollViewHandle
+                implicitWidth: UM.Theme.getSize("scrollbar").width
+                radius: Math.round(implicitWidth / 2)
+
+                color: verticalScrollBar.pressed ? UM.Theme.getColor("scrollbar_handle_down") : verticalScrollBar.hovered ? UM.Theme.getColor("scrollbar_handle_hover") : UM.Theme.getColor("scrollbar_handle")
+                Behavior on color { ColorAnimation { duration: 50; } }
+            }
+        }
+        columnWidthProvider: function(column)
+        {
+            return headerBar.children[column].width; //Cells get the same width as their column header.
+        }
+
+        delegate: Rectangle
+        {
+            implicitHeight: Math.max(1, cellContent.height)
+
+            color: UM.Theme.getColor((tableBase.currentRow == row) ? "primary" : ((row % 2 == 0) ? "main_background" : "viewport_background"))
+
+            Label
+            {
+                id: cellContent
+                width: parent.width
+
+                text: display
+                verticalAlignment: Text.AlignVCenter
+                elide: Text.ElideRight
+                font: UM.Theme.getFont("default")
+                color: UM.Theme.getColor("text")
+            }
+            TextMetrics
+            {
+                id: cellTextMetrics
+                text: cellContent.text
+                font: cellContent.font
+                elide: cellContent.elide
+                elideWidth: cellContent.width
+            }
+            UM.TooltipArea
+            {
+                anchors.fill: parent
+
+                text: (cellTextMetrics.elidedText == cellContent.text) ? "" : cellContent.text //Show full text in tooltip if it was elided.
+                onClicked:
+                {
+                    if(tableBase.allowSelection)
+                    {
+                        tableBase.currentRow = row; //Select this row.
+                    }
+                }
+                onDoubleClicked:
+                {
+                    tableBase.onDoubleClicked(row);
+                }
+            }
+        }
+
+        Connections
+        {
+            target: model
+            function onRowCountChanged()
+            {
+                tableView.contentY = 0; //When the number of rows is reduced, make sure to scroll back to the start.
+            }
+        }
+    }
+}

+ 73 - 38
plugins/ImageReader/ConfigUI.qml

@@ -1,8 +1,9 @@
-// Copyright (c) 2015 Ultimaker B.V.
+// Copyright (c) 2022 Ultimaker B.V.
 // Cura is released under the terms of the LGPLv3 or higher.
 
 import QtQuick 2.1
-import QtQuick.Controls 1.1
+import QtQuick.Controls 1.1 as OldControls
+import QtQuick.Controls 2.15
 import QtQuick.Layouts 1.1
 import QtQuick.Window 2.1
 
@@ -27,20 +28,24 @@ UM.Dialog
         rowSpacing: 4 * screenScaleFactor
         columns: 1
 
-        UM.TooltipArea {
+        UM.TooltipArea
+        {
             Layout.fillWidth:true
             height: childrenRect.height
             text: catalog.i18nc("@info:tooltip","The maximum distance of each pixel from \"Base.\"")
-            Row {
+            Row
+            {
                 width: parent.width
 
-                Label {
+                Label
+                {
                     text: catalog.i18nc("@action:label", "Height (mm)")
                     width: 150 * screenScaleFactor
                     anchors.verticalCenter: parent.verticalCenter
                 }
 
-                TextField {
+                OldControls.TextField
+                {
                     id: peak_height
                     objectName: "Peak_Height"
                     validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/}
@@ -50,20 +55,24 @@ UM.Dialog
             }
         }
 
-        UM.TooltipArea {
+        UM.TooltipArea
+        {
             Layout.fillWidth:true
             height: childrenRect.height
             text: catalog.i18nc("@info:tooltip","The base height from the build plate in millimeters.")
-            Row {
+            Row
+            {
                 width: parent.width
 
-                Label {
+                Label
+                {
                     text: catalog.i18nc("@action:label", "Base (mm)")
                     width: 150 * screenScaleFactor
                     anchors.verticalCenter: parent.verticalCenter
                 }
 
-                TextField {
+                OldControls.TextField
+                {
                     id: base_height
                     objectName: "Base_Height"
                     validator: RegExpValidator {regExp: /^\d{0,3}([\,|\.]\d*)?$/}
@@ -73,20 +82,24 @@ UM.Dialog
             }
         }
 
-        UM.TooltipArea {
+        UM.TooltipArea
+        {
             Layout.fillWidth:true
             height: childrenRect.height
             text: catalog.i18nc("@info:tooltip","The width in millimeters on the build plate.")
-            Row {
+            Row
+            {
                 width: parent.width
 
-                Label {
+                Label
+                {
                     text: catalog.i18nc("@action:label", "Width (mm)")
                     width: 150 * screenScaleFactor
                     anchors.verticalCenter: parent.verticalCenter
                 }
 
-                TextField {
+                OldControls.TextField
+                {
                     id: width
                     objectName: "Width"
                     focus: true
@@ -97,19 +110,23 @@ UM.Dialog
             }
         }
 
-        UM.TooltipArea {
+        UM.TooltipArea
+        {
             Layout.fillWidth:true
             height: childrenRect.height
             text: catalog.i18nc("@info:tooltip","The depth in millimeters on the build plate")
-            Row {
+            Row
+            {
                 width: parent.width
 
-                Label {
+                Label
+                {
                     text: catalog.i18nc("@action:label", "Depth (mm)")
                     width: 150 * screenScaleFactor
                     anchors.verticalCenter: parent.verticalCenter
                 }
-                TextField {
+                OldControls.TextField
+                {
                     id: depth
                     objectName: "Depth"
                     focus: true
@@ -120,20 +137,24 @@ UM.Dialog
             }
         }
 
-        UM.TooltipArea {
+        UM.TooltipArea
+        {
             Layout.fillWidth:true
             height: childrenRect.height
             text: catalog.i18nc("@info:tooltip","For lithophanes dark pixels should correspond to thicker locations in order to block more light coming through. For height maps lighter pixels signify higher terrain, so lighter pixels should correspond to thicker locations in the generated 3D model.")
-            Row {
+            Row
+            {
                 width: parent.width
 
                 //Empty label so 2 column layout works.
-                Label {
+                Label
+                {
                     text: ""
                     width: 150 * screenScaleFactor
                     anchors.verticalCenter: parent.verticalCenter
                 }
-                ComboBox {
+                OldControls.ComboBox
+                {
                     id: lighter_is_higher
                     objectName: "Lighter_Is_Higher"
                     model: [ catalog.i18nc("@item:inlistbox","Darker is higher"), catalog.i18nc("@item:inlistbox","Lighter is higher") ]
@@ -143,19 +164,23 @@ UM.Dialog
             }
         }
 
-        UM.TooltipArea {
+        UM.TooltipArea
+        {
             Layout.fillWidth:true
             height: childrenRect.height
             text: catalog.i18nc("@info:tooltip","For lithophanes a simple logarithmic model for translucency is available. For height maps the pixel values correspond to heights linearly.")
-            Row {
+            Row
+            {
                 width: parent.width
 
-                Label {
+                Label
+                {
                     text: "Color Model"
                     width: 150 * screenScaleFactor
                     anchors.verticalCenter: parent.verticalCenter
                 }
-                ComboBox {
+                OldControls.ComboBox
+                {
                     id: color_model
                     objectName: "ColorModel"
                     model: [ catalog.i18nc("@item:inlistbox","Linear"), catalog.i18nc("@item:inlistbox","Translucency") ]
@@ -165,20 +190,24 @@ UM.Dialog
             }
         }
 
-        UM.TooltipArea {
+        UM.TooltipArea
+        {
             Layout.fillWidth:true
             height: childrenRect.height
             text: catalog.i18nc("@info:tooltip","The percentage of light penetrating a print with a thickness of 1 millimeter. Lowering this value increases the contrast in dark regions and decreases the contrast in light regions of the image.")
             visible: color_model.currentText == catalog.i18nc("@item:inlistbox","Translucency")
-            Row {
+            Row
+            {
                 width: parent.width
 
-                Label {
+                Label
+                {
                     text: catalog.i18nc("@action:label", "1mm Transmittance (%)")
                     width: 150 * screenScaleFactor
                     anchors.verticalCenter: parent.verticalCenter
                 }
-                TextField {
+                OldControls.TextField
+                {
                     id: transmittance
                     objectName: "Transmittance"
                     focus: true
@@ -189,28 +218,34 @@ UM.Dialog
             }
         }
 
-        UM.TooltipArea {
+        UM.TooltipArea
+        {
             Layout.fillWidth:true
             height: childrenRect.height
             text: catalog.i18nc("@info:tooltip","The amount of smoothing to apply to the image.")
-            Row {
+            Row
+            {
                 width: parent.width
 
-                Label {
+                Label
+                {
                     text: catalog.i18nc("@action:label", "Smoothing")
                     width: 150 * screenScaleFactor
                     anchors.verticalCenter: parent.verticalCenter
                 }
 
-                Item {
+                Item
+                {
                     width: 180 * screenScaleFactor
                     height: 20 * screenScaleFactor
                     Layout.fillWidth: true
 
-                    Slider {
+                    Slider
+                    {
                         id: smoothing
                         objectName: "Smoothing"
-                        maximumValue: 100.0
+                        from: 0.0
+                        to: 100.0
                         stepSize: 1.0
                         width: 180
                         onValueChanged: { manager.onSmoothingChanged(value) }
@@ -221,14 +256,14 @@ UM.Dialog
     }
 
     rightButtons: [
-        Button
+        OldControls.Button
         {
             id:ok_button
             text: catalog.i18nc("@action:button","OK");
             onClicked: { manager.onOkButtonClicked() }
             enabled: true
         },
-        Button
+        OldControls.Button
         {
             id:cancel_button
             text: catalog.i18nc("@action:button","Cancel");

+ 3 - 2
plugins/MachineSettingsAction/MachineSettingsAction.qml

@@ -1,5 +1,5 @@
-// Copyright (c) 2019 Ultimaker B.V.
-// Cura is released under the terms of the LGPLv3 or higher.
+//Copyright (c) 2022 Ultimaker B.V.
+//Cura is released under the terms of the LGPLv3 or higher.
 
 import QtQuick 2.10
 import QtQuick.Controls 2.3
@@ -111,6 +111,7 @@ Cura.MachineAction
             model: tabNameModel
             delegate: UM.TabRowButton
             {
+                checked: model.index == 0
                 text: model.name
             }
         }

+ 151 - 152
plugins/PerObjectSettingsTool/PerObjectSettingsPanel.qml

@@ -1,9 +1,10 @@
-// Copyright (c) 2021 Ultimaker B.V.
-// Uranium is released under the terms of the LGPLv3 or higher.
+// Copyright (c) 2022 Ultimaker B.V.
+// Cura is released under the terms of the LGPLv3 or higher.
 
 import QtQuick 2.2
-import QtQuick.Controls 1.2
+import QtQuick.Controls 1.2 as OldControls
 import QtQuick.Controls.Styles 1.2
+import QtQuick.Controls 2.15
 
 import UM 1.5 as UM
 import Cura 1.0 as Cura
@@ -76,7 +77,7 @@ Item
             id: meshTypeButtons
             spacing: UM.Theme.getSize("default_margin").width
 
-            Button
+            OldControls.Button
             {
                 id: normalButton
                 text: catalog.i18nc("@label", "Normal model")
@@ -88,7 +89,7 @@ Item
                 z: 4
             }
 
-            Button
+            OldControls.Button
             {
                 id: supportMeshButton
                 text: catalog.i18nc("@label", "Print as support")
@@ -100,7 +101,7 @@ Item
                 z: 3
             }
 
-            Button
+            OldControls.Button
             {
                 id: overlapMeshButton
                 text: catalog.i18nc("@label", "Modify settings for overlaps")
@@ -112,7 +113,7 @@ Item
                 z: 2
             }
 
-            Button
+            OldControls.Button
             {
                 id: antiOverhangMeshButton
                 text:  catalog.i18nc("@label", "Don't support overlaps")
@@ -179,189 +180,187 @@ Item
             height: Math.min(contents.count * (UM.Theme.getSize("section").height + UM.Theme.getSize("default_lining").height), maximumHeight)
             visible: currentMeshType != "anti_overhang_mesh"
 
-            ScrollView
+            ListView
             {
+                id: contents
                 height: parent.height
                 width: UM.Theme.getSize("setting").width + UM.Theme.getSize("default_margin").width
-                style: UM.Theme.styles.scrollview
 
-                ListView
-                {
-                    id: contents
-                    spacing: UM.Theme.getSize("default_lining").height
+                ScrollBar.vertical: UM.ScrollBar {}
+                clip: true
+                spacing: UM.Theme.getSize("default_lining").height
 
-                    model: UM.SettingDefinitionsModel
+                model: UM.SettingDefinitionsModel
+                {
+                    id: addedSettingsModel
+                    containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
+                    expanded: [ "*" ]
+                    filter:
                     {
-                        id: addedSettingsModel
-                        containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
-                        expanded: [ "*" ]
-                        filter:
-                        {
-                            if (printSequencePropertyProvider.properties.value == "one_at_a_time")
-                            {
-                                return {"settable_per_meshgroup": true}
-                            }
-                            return {"settable_per_mesh": true}
-                        }
-                        exclude:
+                        if (printSequencePropertyProvider.properties.value == "one_at_a_time")
                         {
-                            var excluded_settings = [ "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ]
-
-                            if (currentMeshType == "support_mesh")
-                            {
-                                excluded_settings = excluded_settings.concat(base.allCategoriesExceptSupport)
-                            }
-                            return excluded_settings
+                            return {"settable_per_meshgroup": true}
                         }
+                        return {"settable_per_mesh": true}
+                    }
+                    exclude:
+                    {
+                        var excluded_settings = [ "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ]
 
-                        visibilityHandler: Cura.PerObjectSettingVisibilityHandler
+                        if (currentMeshType == "support_mesh")
                         {
-                            id: visibility_handler
-                            selectedObjectId: UM.ActiveTool.properties.getValue("SelectedObjectId")
+                            excluded_settings = excluded_settings.concat(base.allCategoriesExceptSupport)
                         }
+                        return excluded_settings
+                    }
 
-                        // For some reason the model object is updated after removing him from the memory and
-                        // it happens only on Windows. For this reason, set the destroyed value manually.
-                        Component.onDestruction:
-                        {
-                            setDestroyed(true)
-                        }
+                    visibilityHandler: Cura.PerObjectSettingVisibilityHandler
+                    {
+                        id: visibility_handler
+                        selectedObjectId: UM.ActiveTool.properties.getValue("SelectedObjectId")
+                    }
+
+                    // For some reason the model object is updated after removing him from the memory and
+                    // it happens only on Windows. For this reason, set the destroyed value manually.
+                    Component.onDestruction:
+                    {
+                        setDestroyed(true)
                     }
+                }
 
-                    delegate: Row
+                delegate: Row
+                {
+                    spacing: - UM.Theme.getSize("default_margin").width
+                    Loader
                     {
-                        spacing: - UM.Theme.getSize("default_margin").width
-                        Loader
+                        id: settingLoader
+                        width: UM.Theme.getSize("setting").width
+                        height: UM.Theme.getSize("section").height
+                        enabled: provider.properties.enabled === "True"
+                        property var definition: model
+                        property var settingDefinitionsModel: addedSettingsModel
+                        property var propertyProvider: provider
+                        property var globalPropertyProvider: inheritStackProvider
+                        property var externalResetHandler: false
+
+                        //Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
+                        //In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
+                        //causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
+                        asynchronous: model.type != "enum" && model.type != "extruder"
+
+                        onLoaded:
                         {
-                            id: settingLoader
-                            width: UM.Theme.getSize("setting").width
-                            height: UM.Theme.getSize("section").height
-                            enabled: provider.properties.enabled === "True"
-                            property var definition: model
-                            property var settingDefinitionsModel: addedSettingsModel
-                            property var propertyProvider: provider
-                            property var globalPropertyProvider: inheritStackProvider
-                            property var externalResetHandler: false
-
-                            //Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
-                            //In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
-                            //causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
-                            asynchronous: model.type != "enum" && model.type != "extruder"
-
-                            onLoaded:
-                            {
-                                settingLoader.item.showRevertButton = false
-                                settingLoader.item.showInheritButton = false
-                                settingLoader.item.showLinkedSettingIcon = false
-                                settingLoader.item.doDepthIndentation = false
-                                settingLoader.item.doQualityUserSettingEmphasis = false
-                            }
+                            settingLoader.item.showRevertButton = false
+                            settingLoader.item.showInheritButton = false
+                            settingLoader.item.showLinkedSettingIcon = false
+                            settingLoader.item.doDepthIndentation = false
+                            settingLoader.item.doQualityUserSettingEmphasis = false
+                        }
 
-                            sourceComponent:
+                        sourceComponent:
+                        {
+                            switch(model.type)
                             {
-                                switch(model.type)
-                                {
-                                    case "int":
-                                        return settingTextField
-                                    case "[int]":
-                                        return settingTextField
-                                    case "float":
-                                        return settingTextField
-                                    case "enum":
-                                        return settingComboBox
-                                    case "extruder":
-                                        return settingExtruder
-                                    case "optional_extruder":
-                                        return settingOptionalExtruder
-                                    case "bool":
-                                        return settingCheckBox
-                                    case "str":
-                                        return settingTextField
-                                    case "category":
-                                        return settingCategory
-                                    default:
-                                        return settingUnknown
-                                }
+                                case "int":
+                                    return settingTextField
+                                case "[int]":
+                                    return settingTextField
+                                case "float":
+                                    return settingTextField
+                                case "enum":
+                                    return settingComboBox
+                                case "extruder":
+                                    return settingExtruder
+                                case "optional_extruder":
+                                    return settingOptionalExtruder
+                                case "bool":
+                                    return settingCheckBox
+                                case "str":
+                                    return settingTextField
+                                case "category":
+                                    return settingCategory
+                                default:
+                                    return settingUnknown
                             }
                         }
+                    }
 
-                        Button
-                        {
-                            width: Math.round(UM.Theme.getSize("setting").height / 2)
-                            height: UM.Theme.getSize("setting").height
+                    OldControls.Button
+                    {
+                        width: Math.round(UM.Theme.getSize("setting").height / 2)
+                        height: UM.Theme.getSize("setting").height
 
-                            onClicked: addedSettingsModel.setVisible(model.key, false)
+                        onClicked: addedSettingsModel.setVisible(model.key, false)
 
-                            style: ButtonStyle
+                        style: ButtonStyle
+                        {
+                            background: Item
                             {
-                                background: Item
+                                UM.RecolorImage
                                 {
-                                    UM.RecolorImage
-                                    {
-                                        anchors.verticalCenter: parent.verticalCenter
-                                        width: parent.width
-                                        height: width
-                                        sourceSize.height: width
-                                        color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button")
-                                        source: UM.Theme.getIcon("Minus")
-                                    }
+                                    anchors.verticalCenter: parent.verticalCenter
+                                    width: parent.width
+                                    height: width
+                                    sourceSize.height: width
+                                    color: control.hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button")
+                                    source: UM.Theme.getIcon("Minus")
                                 }
                             }
                         }
+                    }
 
-                        // Specialty provider that only watches global_inherits (we can't filter on what property changed we get events
-                        // so we bypass that to make a dedicated provider).
-                        UM.SettingPropertyProvider
-                        {
-                            id: provider
+                    // Specialty provider that only watches global_inherits (we can't filter on what property changed we get events
+                    // so we bypass that to make a dedicated provider).
+                    UM.SettingPropertyProvider
+                    {
+                        id: provider
 
-                            containerStackId: UM.ActiveTool.properties.getValue("ContainerID")
-                            key: model.key
-                            watchedProperties: [ "value", "enabled", "validationState" ]
-                            storeIndex: 0
-                            removeUnusedValue: false
-                        }
+                        containerStackId: UM.ActiveTool.properties.getValue("ContainerID")
+                        key: model.key
+                        watchedProperties: [ "value", "enabled", "validationState" ]
+                        storeIndex: 0
+                        removeUnusedValue: false
+                    }
 
-                        UM.SettingPropertyProvider
-                        {
-                            id: inheritStackProvider
-                            containerStackId: UM.ActiveTool.properties.getValue("ContainerID")
-                            key: model.key
-                            watchedProperties: [ "limit_to_extruder" ]
-                        }
+                    UM.SettingPropertyProvider
+                    {
+                        id: inheritStackProvider
+                        containerStackId: UM.ActiveTool.properties.getValue("ContainerID")
+                        key: model.key
+                        watchedProperties: [ "limit_to_extruder" ]
+                    }
 
-                        Connections
-                        {
-                            target: inheritStackProvider
-                            function onPropertiesChanged() { provider.forcePropertiesChanged() }
-                        }
+                    Connections
+                    {
+                        target: inheritStackProvider
+                        function onPropertiesChanged() { provider.forcePropertiesChanged() }
+                    }
 
-                        Connections
+                    Connections
+                    {
+                        target: UM.ActiveTool
+                        function onPropertiesChanged()
                         {
-                            target: UM.ActiveTool
-                            function onPropertiesChanged()
+                            // the values cannot be bound with UM.ActiveTool.properties.getValue() calls,
+                            // so here we connect to the signal and update the those values.
+                            if (typeof UM.ActiveTool.properties.getValue("SelectedObjectId") !== "undefined")
+                            {
+                                const selectedObjectId = UM.ActiveTool.properties.getValue("SelectedObjectId")
+                                if (addedSettingsModel.visibilityHandler.selectedObjectId != selectedObjectId)
+                                {
+                                    addedSettingsModel.visibilityHandler.selectedObjectId = selectedObjectId
+                                }
+                            }
+                            if (typeof UM.ActiveTool.properties.getValue("ContainerID") !== "undefined")
                             {
-                                // the values cannot be bound with UM.ActiveTool.properties.getValue() calls,
-                                // so here we connect to the signal and update the those values.
-                                if (typeof UM.ActiveTool.properties.getValue("SelectedObjectId") !== "undefined")
+                                const containerId = UM.ActiveTool.properties.getValue("ContainerID")
+                                if (provider.containerStackId != containerId)
                                 {
-                                    const selectedObjectId = UM.ActiveTool.properties.getValue("SelectedObjectId")
-                                    if (addedSettingsModel.visibilityHandler.selectedObjectId != selectedObjectId)
-                                    {
-                                        addedSettingsModel.visibilityHandler.selectedObjectId = selectedObjectId
-                                    }
+                                    provider.containerStackId = containerId
                                 }
-                                if (typeof UM.ActiveTool.properties.getValue("ContainerID") !== "undefined")
+                                if (inheritStackProvider.containerStackId != containerId)
                                 {
-                                    const containerId = UM.ActiveTool.properties.getValue("ContainerID")
-                                    if (provider.containerStackId != containerId)
-                                    {
-                                        provider.containerStackId = containerId
-                                    }
-                                    if (inheritStackProvider.containerStackId != containerId)
-                                    {
-                                        inheritStackProvider.containerStackId = containerId
-                                    }
+                                    inheritStackProvider.containerStackId = containerId
                                 }
                             }
                         }

+ 38 - 36
plugins/PerObjectSettingsTool/SettingPickDialog.qml

@@ -1,7 +1,10 @@
+// Copyright (c) 2022 Ultimaker B.V.
+// Cura is released under the terms of the LGPLv3 or higher.
+
 import QtQuick 2.2
-import QtQuick.Controls 1.2
+import QtQuick.Controls 2.2
 
-import UM 1.2 as UM
+import UM 1.5 as UM
 import Cura 1.0 as Cura
 import ".."
 
@@ -67,10 +70,9 @@ UM.Dialog
         text: catalog.i18nc("@label:checkbox", "Show all")
     }
 
-    ScrollView
+    ListView
     {
-        id: scrollView
-
+        id: listview
         anchors
         {
             top: filterInput.bottom
@@ -78,47 +80,47 @@ UM.Dialog
             right: parent.right
             bottom: parent.bottom
         }
-        ListView
+
+        ScrollBar.vertical: UM.ScrollBar {}
+        clip: true
+
+        model: UM.SettingDefinitionsModel
         {
-            id: listview
-            model: UM.SettingDefinitionsModel
+            id: definitionsModel
+            containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
+            visibilityHandler: UM.SettingPreferenceVisibilityHandler {}
+            expanded: [ "*" ]
+            exclude:
             {
-                id: definitionsModel
-                containerId: Cura.MachineManager.activeMachine != null ? Cura.MachineManager.activeMachine.definition.id: ""
-                visibilityHandler: UM.SettingPreferenceVisibilityHandler {}
-                expanded: [ "*" ]
-                exclude:
-                {
-                    var excluded_settings = [ "machine_settings", "command_line_settings", "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ]
-                    excluded_settings = excluded_settings.concat(settingPickDialog.additional_excluded_settings)
-                    return excluded_settings
-                }
-                showAll: toggleShowAll.checked || filterInput.text !== ""
+                var excluded_settings = [ "machine_settings", "command_line_settings", "support_mesh", "anti_overhang_mesh", "cutting_mesh", "infill_mesh" ]
+                excluded_settings = excluded_settings.concat(settingPickDialog.additional_excluded_settings)
+                return excluded_settings
             }
-            delegate: Loader
-            {
-                id: loader
+            showAll: toggleShowAll.checked || filterInput.text !== ""
+        }
+        delegate: Loader
+        {
+            id: loader
 
-                width: listview.width
-                height: model.type != undefined ? UM.Theme.getSize("section").height : 0
+            width: listview.width
+            height: model.type != undefined ? UM.Theme.getSize("section").height : 0
 
-                property var definition: model
-                property var settingDefinitionsModel: definitionsModel
+            property var definition: model
+            property var settingDefinitionsModel: definitionsModel
 
-                asynchronous: true
-                source:
+            asynchronous: true
+            source:
+            {
+                switch(model.type)
                 {
-                    switch(model.type)
-                    {
-                        case "category":
-                            return "PerObjectCategory.qml"
-                        default:
-                            return "PerObjectItem.qml"
-                    }
+                    case "category":
+                        return "PerObjectCategory.qml"
+                    default:
+                        return "PerObjectItem.qml"
                 }
             }
-            Component.onCompleted: settingPickDialog.updateFilter()
         }
+        Component.onCompleted: settingPickDialog.updateFilter()
     }
 
     rightButtons: [

+ 107 - 111
plugins/PostProcessingPlugin/PostProcessingPlugin.qml

@@ -1,4 +1,4 @@
-// Copyright (c) 2015 Jaime van Kessel, Ultimaker B.V.
+// Copyright (c) 2022 Jaime van Kessel, Ultimaker B.V.
 // The PostProcessingPlugin is released under the terms of the AGPLv3 or higher.
 
 import QtQuick 2.2
@@ -8,7 +8,7 @@ import QtQuick.Layouts 1.1
 import QtQuick.Dialogs 1.1
 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
@@ -34,7 +34,7 @@ UM.Dialog
         UM.I18nCatalog{id: catalog; name: "cura"}
         id: base
         property int columnWidth: Math.round((base.width / 2) - UM.Theme.getSize("default_margin").width)
-        property int textMargin: Math.round(UM.Theme.getSize("default_margin").width / 2)
+        property int textMargin: UM.Theme.getSize("narrow_margin").width
         property string activeScriptName
         SystemPalette{ id: palette }
         SystemPalette{ id: disabledPalette; colorGroup: SystemPalette.Disabled }
@@ -44,19 +44,18 @@ UM.Dialog
         {
             id: selectedScriptGroup
         }
-        Item
+        Column
         {
             id: activeScripts
-            anchors.left: parent.left
             width: base.columnWidth
             height: parent.height
 
+            spacing: base.textMargin
+
             Label
             {
                 id: activeScriptsHeader
                 text: catalog.i18nc("@label", "Post Processing Scripts")
-                anchors.top: parent.top
-                anchors.topMargin: base.textMargin
                 anchors.left: parent.left
                 anchors.leftMargin: base.textMargin
                 anchors.right: parent.right
@@ -67,22 +66,24 @@ UM.Dialog
             ListView
             {
                 id: activeScriptsList
-
                 anchors
                 {
-                    top: activeScriptsHeader.bottom
                     left: parent.left
+                    leftMargin: UM.Theme.getSize("default_margin").width
                     right: parent.right
                     rightMargin: base.textMargin
-                    topMargin: base.textMargin
-                    leftMargin: UM.Theme.getSize("default_margin").width
                 }
+                height: Math.min(contentHeight, parent.height - parent.spacing * 2 - activeScriptsHeader.height - addButton.height) //At the window height, start scrolling this one.
 
-                height: childrenRect.height
+                clip: true
+                ScrollBar.vertical: UM.ScrollBar
+                {
+                    id: activeScriptsScrollBar
+                }
                 model: manager.scriptList
                 delegate: Item
                 {
-                    width: parent.width
+                    width: parent.width - activeScriptsScrollBar.width
                     height: activeScriptButton.height
                     Button
                     {
@@ -132,8 +133,7 @@ UM.Dialog
                         text: "x"
                         width: 20 * screenScaleFactor
                         height: 20 * screenScaleFactor
-                        anchors.right:parent.right
-                        anchors.rightMargin: base.textMargin
+                        anchors.right: parent.right
                         anchors.verticalCenter: parent.verticalCenter
                         onClicked: manager.removeScriptByIndex(index)
                         contentItem: Item
@@ -221,8 +221,6 @@ UM.Dialog
                 text: catalog.i18nc("@action", "Add a script")
                 anchors.left: parent.left
                 anchors.leftMargin: base.textMargin
-                anchors.top: activeScriptsList.bottom
-                anchors.topMargin: base.textMargin
                 onClicked: scriptsMenu.open()
             }
             Menu
@@ -275,9 +273,9 @@ UM.Dialog
                 color: UM.Theme.getColor("text")
             }
 
-            ScrollView
+            ListView
             {
-                id: scrollView
+                id: listview
                 anchors
                 {
                     top: scriptSpecsHeader.bottom
@@ -288,123 +286,121 @@ UM.Dialog
                     bottom: parent.bottom
                 }
 
+                ScrollBar.vertical: UM.ScrollBar {}
+                clip: true
                 visible: manager.selectedScriptDefinitionId != ""
+                spacing: UM.Theme.getSize("default_lining").height
 
-                ListView
+                model: UM.SettingDefinitionsModel
                 {
-                    id: listview
-                    spacing: UM.Theme.getSize("default_lining").height
-                    model: UM.SettingDefinitionsModel
-                    {
-                        id: definitionsModel
-                        containerId: manager.selectedScriptDefinitionId
-                        showAll: true
-                    }
+                    id: definitionsModel
+                    containerId: manager.selectedScriptDefinitionId
+                    showAll: true
+                }
 
-                    delegate: Loader
-                    {
-                        id: settingLoader
+                delegate: Loader
+                {
+                    id: settingLoader
 
-                        width: parent.width
-                        height:
+                    width: listview.width
+                    height:
+                    {
+                        if(provider.properties.enabled == "True")
                         {
-                            if(provider.properties.enabled == "True")
+                            if(model.type != undefined)
                             {
-                                if(model.type != undefined)
-                                {
-                                    return UM.Theme.getSize("section").height
-                                }
-                                else
-                                {
-                                    return 0
-                                }
+                                return UM.Theme.getSize("section").height
                             }
                             else
                             {
                                 return 0
                             }
                         }
-                        Behavior on height { NumberAnimation { duration: 100 } }
-                        opacity: provider.properties.enabled == "True" ? 1 : 0
-
-                        Behavior on opacity { NumberAnimation { duration: 100 } }
-                        enabled: opacity > 0
+                        else
+                        {
+                            return 0
+                        }
+                    }
+                    Behavior on height { NumberAnimation { duration: 100 } }
+                    opacity: provider.properties.enabled == "True" ? 1 : 0
 
-                        property var definition: model
-                        property var settingDefinitionsModel: definitionsModel
-                        property var propertyProvider: provider
-                        property var globalPropertyProvider: inheritStackProvider
+                    Behavior on opacity { NumberAnimation { duration: 100 } }
+                    enabled: opacity > 0
 
-                        //Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
-                        //In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
-                        //causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
-                        asynchronous: model.type != "enum" && model.type != "extruder"
+                    property var definition: model
+                    property var settingDefinitionsModel: definitionsModel
+                    property var propertyProvider: provider
+                    property var globalPropertyProvider: inheritStackProvider
 
-                        onLoaded:
-                        {
-                            settingLoader.item.showRevertButton = false
-                            settingLoader.item.showInheritButton = false
-                            settingLoader.item.showLinkedSettingIcon = false
-                            settingLoader.item.doDepthIndentation = false
-                            settingLoader.item.doQualityUserSettingEmphasis = false
-                        }
+                    //Qt5.4.2 and earlier has a bug where this causes a crash: https://bugreports.qt.io/browse/QTBUG-35989
+                    //In addition, while it works for 5.5 and higher, the ordering of the actual combo box drop down changes,
+                    //causing nasty issues when selecting different options. So disable asynchronous loading of enum type completely.
+                    asynchronous: model.type != "enum" && model.type != "extruder"
 
-                        sourceComponent:
-                        {
-                            switch(model.type)
-                            {
-                                case "int":
-                                    return settingTextField
-                                case "float":
-                                    return settingTextField
-                                case "enum":
-                                    return settingComboBox
-                                case "extruder":
-                                    return settingExtruder
-                                case "bool":
-                                    return settingCheckBox
-                                case "str":
-                                    return settingTextField
-                                case "category":
-                                    return settingCategory
-                                default:
-                                    return settingUnknown
-                            }
-                        }
+                    onLoaded:
+                    {
+                        settingLoader.item.showRevertButton = false
+                        settingLoader.item.showInheritButton = false
+                        settingLoader.item.showLinkedSettingIcon = false
+                        settingLoader.item.doDepthIndentation = false
+                        settingLoader.item.doQualityUserSettingEmphasis = false
+                    }
 
-                        UM.SettingPropertyProvider
+                    sourceComponent:
+                    {
+                        switch(model.type)
                         {
-                            id: provider
-                            containerStackId: manager.selectedScriptStackId
-                            key: model.key ? model.key : "None"
-                            watchedProperties: [ "value", "enabled", "state", "validationState" ]
-                            storeIndex: 0
+                            case "int":
+                                return settingTextField
+                            case "float":
+                                return settingTextField
+                            case "enum":
+                                return settingComboBox
+                            case "extruder":
+                                return settingExtruder
+                            case "bool":
+                                return settingCheckBox
+                            case "str":
+                                return settingTextField
+                            case "category":
+                                return settingCategory
+                            default:
+                                return settingUnknown
                         }
+                    }
 
-                        // Specialty provider that only watches global_inherits (we can't filter on what property changed we get events
-                        // so we bypass that to make a dedicated provider).
-                        UM.SettingPropertyProvider
-                        {
-                            id: inheritStackProvider
-                            containerStack: Cura.MachineManager.activeMachine
-                            key: model.key ? model.key : "None"
-                            watchedProperties: [ "limit_to_extruder" ]
-                        }
+                    UM.SettingPropertyProvider
+                    {
+                        id: provider
+                        containerStackId: manager.selectedScriptStackId
+                        key: model.key ? model.key : "None"
+                        watchedProperties: [ "value", "enabled", "state", "validationState" ]
+                        storeIndex: 0
+                    }
 
-                        Connections
-                        {
-                            target: item
+                    // Specialty provider that only watches global_inherits (we can't filter on what property changed we get events
+                    // so we bypass that to make a dedicated provider).
+                    UM.SettingPropertyProvider
+                    {
+                        id: inheritStackProvider
+                        containerStack: Cura.MachineManager.activeMachine
+                        key: model.key ? model.key : "None"
+                        watchedProperties: [ "limit_to_extruder" ]
+                    }
 
-                            function onShowTooltip(text)
-                            {
-                                tooltip.text = text
-                                var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0)
-                                tooltip.show(position)
-                                tooltip.target.x = position.x + 1
-                            }
+                    Connections
+                    {
+                        target: item
 
-                            function onHideTooltip() { tooltip.hide() }
+                        function onShowTooltip(text)
+                        {
+                            tooltip.text = text
+                            var position = settingLoader.mapToItem(settingsPanel, settingsPanel.x, 0)
+                            tooltip.show(position)
+                            tooltip.target.x = position.x + 1
                         }
+
+                        function onHideTooltip() { tooltip.hide() }
                     }
                 }
             }

Some files were not shown because too many files changed in this diff