Fixes this error

QML Column: ScrollBar must be attached to a Flickable or ScrollView

by wrapping the Column in a ScrollView the same way that is done for the information page.

CURA-8979
This commit is contained in:
j.delarago 2022-03-18 14:45:03 +01:00
parent bd91078e6e
commit c10865b179

View File

@ -18,8 +18,6 @@ Item
property bool editingEnabled: false property bool editingEnabled: false
property string currency: UM.Preferences.getValue("cura/currency") ? UM.Preferences.getValue("cura/currency") : "€" property string currency: UM.Preferences.getValue("cura/currency") ? UM.Preferences.getValue("cura/currency") : "€"
property real firstColumnWidth: (width * 0.50) | 0
property real secondColumnWidth: (width * 0.40) | 0
property string containerId: "" property string containerId: ""
property var materialPreferenceValues: UM.Preferences.getValue("cura/material_settings") ? JSON.parse(UM.Preferences.getValue("cura/material_settings")) : {} property var materialPreferenceValues: UM.Preferences.getValue("cura/material_settings") ? JSON.parse(UM.Preferences.getValue("cura/material_settings")) : {}
property var materialManagementModel: CuraApplication.getMaterialManagementModel() property var materialManagementModel: CuraApplication.getMaterialManagementModel()
@ -517,18 +515,40 @@ Item
} }
} }
Column ScrollView
{ {
id: settingsPage
visible: pageSelectorTabRow.currentItem.activeView === "settings" visible: pageSelectorTabRow.currentItem.activeView === "settings"
spacing: UM.Theme.getSize("narrow_margin").height
anchors.fill: parent
anchors.topMargin: UM.Theme.getSize("thin_margin").height
anchors.bottomMargin: UM.Theme.getSize("thin_margin").height
anchors.leftMargin: UM.Theme.getSize("thin_margin").width
anchors.rightMargin: UM.Theme.getSize("thin_margin").width
ScrollBar.vertical: UM.ScrollBar {}
clip: true clip: true
anchors
{
fill: parent
topMargin: UM.Theme.getSize("thin_margin").height
bottomMargin: UM.Theme.getSize("thin_margin").height
leftMargin: UM.Theme.getSize("thin_margin").width
rightMargin: UM.Theme.getSize("thin_margin").width
}
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
ScrollBar.vertical: UM.ScrollBar
{
id: settingScrollBar
parent: settingsPage
anchors
{
top: parent.top
right: parent.right
bottom: parent.bottom
}
}
property real columnWidth: Math.floor((width - settingScrollBar.width - UM.Theme.getSize("narrow_margin").width) / 2)
Column
{
width: settingsPage.width
spacing: UM.Theme.getSize("narrow_margin").height
Repeater Repeater
{ {
model: UM.SettingDefinitionsModel model: UM.SettingDefinitionsModel
@ -551,7 +571,7 @@ Item
UM.Label UM.Label
{ {
id: label id: label
width: base.firstColumnWidth; width: settingsPage.columnWidth
height: spinBox.height + UM.Theme.getSize("default_lining").height height: spinBox.height + UM.Theme.getSize("default_lining").height
text: model.label text: model.label
elide: Text.ElideRight elide: Text.ElideRight
@ -580,7 +600,7 @@ Item
} }
return 0; return 0;
} }
width: base.secondColumnWidth width: settingsPage.columnWidth
suffix: " " + model.unit suffix: " " + model.unit
to: 99999 to: 99999
decimals: model.unit == "mm" ? 2 : 0 decimals: model.unit == "mm" ? 2 : 0
@ -613,6 +633,7 @@ Item
} }
} }
} }
}
UM.TabRow UM.TabRow
{ {