Use re-useable scrollbar and remove ScrollView

The machine selector has the scroll view inside of the listview. It just needs to use our new scrollbar element instead of the default.

Contributes to issue CURA-8686.
This commit is contained in:
Ghostkeeper 2022-01-19 14:32:12 +01:00
parent 7e1b92953c
commit c57126fb00
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A
2 changed files with 22 additions and 33 deletions

View file

@ -14,10 +14,15 @@ ListView
section.property: "hasRemoteConnection"
property real contentHeight: childrenRect.height
ScrollBar.vertical: UM.ScrollBar
{
id: scrollBar
}
section.delegate: UM.Label
{
text: section == "true" ? catalog.i18nc("@label", "Connected printers") : catalog.i18nc("@label", "Preset printers")
width: parent.width
width: parent.width - scrollBar.width
height: UM.Theme.getSize("action_button").height
leftPadding: UM.Theme.getSize("default_margin").width
font: UM.Theme.getFont("medium")
@ -27,7 +32,7 @@ ListView
delegate: MachineSelectorButton
{
text: model.name ? model.name : ""
width: listView.width
width: listView.width - scrollBar.width
outputDevice: Cura.MachineManager.printerOutputDevices.length >= 1 ? Cura.MachineManager.printerOutputDevices[0] : null
checked: Cura.MachineManager.activeMachine ? Cura.MachineManager.activeMachine.id == model.id : false