From 0069182c6b8ee09cbc2fc7cd2f7dde09e9357a47 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 29 Nov 2021 16:11:15 +0100 Subject: [PATCH] Set position and width of card in details page This means that the card itself shouldn't specify a width. It should get a width from how it's used. Contributes to issue CURA-8565. --- plugins/Marketplace/resources/qml/PackageCard.qml | 1 - plugins/Marketplace/resources/qml/PackageDetails.qml | 9 +++++++++ plugins/Marketplace/resources/qml/Packages.qml | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/plugins/Marketplace/resources/qml/PackageCard.qml b/plugins/Marketplace/resources/qml/PackageCard.qml index f57facf0c0..448be8ff75 100644 --- a/plugins/Marketplace/resources/qml/PackageCard.qml +++ b/plugins/Marketplace/resources/qml/PackageCard.qml @@ -12,7 +12,6 @@ Rectangle { property var packageData - width: parent ? parent.width - UM.Theme.getSize("default_margin").width - UM.Theme.getSize("narrow_margin").width: 0 height: UM.Theme.getSize("card").height color: UM.Theme.getColor("main_background") radius: UM.Theme.getSize("default_radius").width diff --git a/plugins/Marketplace/resources/qml/PackageDetails.qml b/plugins/Marketplace/resources/qml/PackageDetails.qml index 49e4d97633..7db46300a8 100644 --- a/plugins/Marketplace/resources/qml/PackageDetails.qml +++ b/plugins/Marketplace/resources/qml/PackageDetails.qml @@ -70,6 +70,15 @@ Item PackageCard { packageData: detailPage.packageData + 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 + } } } } \ No newline at end of file diff --git a/plugins/Marketplace/resources/qml/Packages.qml b/plugins/Marketplace/resources/qml/Packages.qml index 89254f2526..47318d5a72 100644 --- a/plugins/Marketplace/resources/qml/Packages.qml +++ b/plugins/Marketplace/resources/qml/Packages.qml @@ -77,6 +77,7 @@ ListView PackageCard { packageData: model.package + width: parent.width - UM.Theme.getSize("default_margin").width - UM.Theme.getSize("narrow_margin").width } }