mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 15:13:56 -06:00
Fix scrolling through post-processing scripts list
It turns out this has been broken for a while. I don't think anyone adds that many scripts that they'd need to scroll this, but if they want to they can now. Contributes to issue CURA-8686.
This commit is contained in:
parent
efc748cc99
commit
796779316f
1 changed files with 13 additions and 15 deletions
|
@ -34,7 +34,7 @@ UM.Dialog
|
||||||
UM.I18nCatalog{id: catalog; name: "cura"}
|
UM.I18nCatalog{id: catalog; name: "cura"}
|
||||||
id: base
|
id: base
|
||||||
property int columnWidth: Math.round((base.width / 2) - UM.Theme.getSize("default_margin").width)
|
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
|
property string activeScriptName
|
||||||
SystemPalette{ id: palette }
|
SystemPalette{ id: palette }
|
||||||
SystemPalette{ id: disabledPalette; colorGroup: SystemPalette.Disabled }
|
SystemPalette{ id: disabledPalette; colorGroup: SystemPalette.Disabled }
|
||||||
|
@ -44,19 +44,18 @@ UM.Dialog
|
||||||
{
|
{
|
||||||
id: selectedScriptGroup
|
id: selectedScriptGroup
|
||||||
}
|
}
|
||||||
Item
|
Column
|
||||||
{
|
{
|
||||||
id: activeScripts
|
id: activeScripts
|
||||||
anchors.left: parent.left
|
|
||||||
width: base.columnWidth
|
width: base.columnWidth
|
||||||
height: parent.height
|
height: parent.height
|
||||||
|
|
||||||
|
spacing: base.textMargin
|
||||||
|
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
id: activeScriptsHeader
|
id: activeScriptsHeader
|
||||||
text: catalog.i18nc("@label", "Post Processing Scripts")
|
text: catalog.i18nc("@label", "Post Processing Scripts")
|
||||||
anchors.top: parent.top
|
|
||||||
anchors.topMargin: base.textMargin
|
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: base.textMargin
|
anchors.leftMargin: base.textMargin
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
@ -67,22 +66,24 @@ UM.Dialog
|
||||||
ListView
|
ListView
|
||||||
{
|
{
|
||||||
id: activeScriptsList
|
id: activeScriptsList
|
||||||
|
|
||||||
anchors
|
anchors
|
||||||
{
|
{
|
||||||
top: activeScriptsHeader.bottom
|
|
||||||
left: parent.left
|
left: parent.left
|
||||||
|
leftMargin: UM.Theme.getSize("default_margin").width
|
||||||
right: parent.right
|
right: parent.right
|
||||||
rightMargin: base.textMargin
|
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
|
model: manager.scriptList
|
||||||
delegate: Item
|
delegate: Item
|
||||||
{
|
{
|
||||||
width: parent.width
|
width: parent.width - activeScriptsScrollBar.width
|
||||||
height: activeScriptButton.height
|
height: activeScriptButton.height
|
||||||
Button
|
Button
|
||||||
{
|
{
|
||||||
|
@ -132,8 +133,7 @@ UM.Dialog
|
||||||
text: "x"
|
text: "x"
|
||||||
width: 20 * screenScaleFactor
|
width: 20 * screenScaleFactor
|
||||||
height: 20 * screenScaleFactor
|
height: 20 * screenScaleFactor
|
||||||
anchors.right:parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: base.textMargin
|
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
onClicked: manager.removeScriptByIndex(index)
|
onClicked: manager.removeScriptByIndex(index)
|
||||||
contentItem: Item
|
contentItem: Item
|
||||||
|
@ -221,8 +221,6 @@ UM.Dialog
|
||||||
text: catalog.i18nc("@action", "Add a script")
|
text: catalog.i18nc("@action", "Add a script")
|
||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.leftMargin: base.textMargin
|
anchors.leftMargin: base.textMargin
|
||||||
anchors.top: activeScriptsList.bottom
|
|
||||||
anchors.topMargin: base.textMargin
|
|
||||||
onClicked: scriptsMenu.open()
|
onClicked: scriptsMenu.open()
|
||||||
}
|
}
|
||||||
Menu
|
Menu
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue