From b585c02207fdedc9afc7622f1bb1cdfcb278c76e Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Thu, 21 Oct 2021 16:35:54 +0200 Subject: [PATCH] Add background to page content, and restructure margins To display the background across the entire bottom side and not with the margins of the column, we have to restructure where the margins are a bit. Contributes to issue CURA-8556. --- .../Marketplace/resources/qml/Marketplace.qml | 34 ++++++++++++++----- resources/themes/cura-light/theme.json | 1 + 2 files changed, 27 insertions(+), 8 deletions(-) diff --git a/plugins/Marketplace/resources/qml/Marketplace.qml b/plugins/Marketplace/resources/qml/Marketplace.qml index b0b3d904e5..2b17d3ebf3 100644 --- a/plugins/Marketplace/resources/qml/Marketplace.qml +++ b/plugins/Marketplace/resources/qml/Marketplace.qml @@ -29,25 +29,43 @@ Window ColumnLayout { anchors.fill: parent - anchors.margins: UM.Theme.getSize("default_margin").width spacing: UM.Theme.getSize("default_margin").height - Label //Page title. + Item //Page title. { Layout.preferredWidth: parent.width - Layout.preferredHeight: contentHeight + Layout.preferredHeight: childrenRect.height + UM.Theme.getSize("default_margin").height - font: UM.Theme.getFont("large") - color: UM.Theme.getColor("text") - text: catalog.i18nc("@header", "Install Plugins") + Label + { + anchors + { + left: parent.left + leftMargin: UM.Theme.getSize("default_margin").width + right: parent.right + rightMargin: UM.Theme.getSize("default_margin").width + bottom: parent.bottom + } + + font: UM.Theme.getFont("large") + color: UM.Theme.getColor("text") + text: catalog.i18nc("@header", "Install Plugins") + } } - Loader //Page contents. + Rectangle //Page contents. { Layout.preferredWidth: parent.width Layout.fillHeight: true + color: UM.Theme.getColor("detail_background") - source: "Plugins.qml" + Loader //Page contents. + { + anchors.fill: parent + anchors.margins: UM.Theme.getSize("default_margin").width + + source: "Plugins.qml" + } } } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index 78676da926..0f7ca004f9 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -173,6 +173,7 @@ "colors": { "main_background": [255, 255, 255, 255], + "detail_background": [243, 243, 243, 255], "wide_lining": [245, 245, 245, 255], "thick_lining": [180, 180, 180, 255], "lining": [192, 193, 194, 255],