Ensure that scrollbar is centered

CURA-8762
This commit is contained in:
Jaime van Kessel 2022-02-22 16:07:11 +01:00
parent a36fedabe5
commit 0d85b2be7f

View File

@ -53,8 +53,8 @@ ListView
// Vertical ScrollBar, styled similarly to the scrollBar in the settings panel
id: verticalScrollBar
visible: packages.contentHeight > packages.height
background: Item{}
anchors.right: parent.right
background: Item {}
contentItem: Rectangle
{
@ -83,7 +83,16 @@ ListView
{
manageableInListView: packages.packagesManageableInListView
packageData: model.package
width: parent.width - UM.Theme.getSize("default_margin").width - UM.Theme.getSize("narrow_margin").width
width: {
if(verticalScrollBar.visible)
{
return parent.width - UM.Theme.getSize("default_margin").width - UM.Theme.getSize("default_margin").width
}
else
{
return parent.width - UM.Theme.getSize("default_margin").width
}
}
color: cardMouseArea.containsMouse ? UM.Theme.getColor("action_button_hovered") : UM.Theme.getColor("main_background")
}
}