From 2b419a23796bfede7b701bfaf235d128eb74b9f3 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 29 Nov 2021 19:04:30 +0100 Subject: [PATCH] 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. --- .../resources/qml/PackageDetails.qml | 34 ++++++++++++------- 1 file changed, 22 insertions(+), 12 deletions(-) diff --git a/plugins/Marketplace/resources/qml/PackageDetails.qml b/plugins/Marketplace/resources/qml/PackageDetails.qml index c1ef765a14..1ccb3dc4fd 100644 --- a/plugins/Marketplace/resources/qml/PackageDetails.qml +++ b/plugins/Marketplace/resources/qml/PackageDetails.qml @@ -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 + } } } } \ No newline at end of file