Make package detail page scroll if details are too long

Some plug-ins could have very long descriptions now. We show all of it, but that could go off the screen in theory.

This makes the content scrollable if it goes off the screen.

Contributes to issue CURA-8565.
This commit is contained in:
Ghostkeeper 2021-11-29 19:04:30 +01:00 committed by Jelle Spijker
parent b1af7ad203
commit 2b419a2379
No known key found for this signature in database
GPG key ID: 6662DC033BE6B99A

View file

@ -67,20 +67,30 @@ Item
}
color: UM.Theme.getColor("detail_background")
PackageCard
ScrollView
{
anchors
{
left: parent.left
leftMargin: UM.Theme.getSize("default_margin").width
right: parent.right
rightMargin: anchors.leftMargin
top: parent.top
topMargin: UM.Theme.getSize("default_margin").height
}
anchors.fill: parent
packageData: detailPage.packageData
expanded: true
clip: true //Need to clip, not for the bottom (which is off the window) but for the top (which would overlap the header).
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
contentHeight: expandedPackageCard.height + UM.Theme.getSize("default_margin").height * 2
PackageCard
{
id: expandedPackageCard
anchors
{
left: parent.left
leftMargin: UM.Theme.getSize("default_margin").width
right: parent.right
rightMargin: anchors.leftMargin
top: parent.top
topMargin: UM.Theme.getSize("default_margin").height
}
packageData: detailPage.packageData
expanded: true
}
}
}
}