From c3f3b8dd93f18ecaf54c32825f1c5a73d2f0c2f6 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 7 May 2019 08:58:45 +0200 Subject: [PATCH 1/6] Change links and compatibility chart. --- .../qml/ToolboxCompatibilityChart.qml | 74 ++++++------------- .../resources/qml/ToolboxDetailTile.qml | 30 ++++---- .../resources/qml/ToolboxInstalledTile.qml | 2 +- 3 files changed, 36 insertions(+), 70 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml index db4e8c628f..770082092f 100644 --- a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml +++ b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml @@ -1,9 +1,9 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2019 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 + import UM 1.1 as UM Item @@ -11,52 +11,19 @@ Item id: base property var packageData - property var technicalDataSheetUrl: - { - var link = undefined - if ("Technical Data Sheet" in packageData.links) - { - // HACK: This is the way the old API (used in 3.6-beta) used to do it. For safety it's still here, - // but it can be removed over time. - link = packageData.links["Technical Data Sheet"] - } - else if ("technicalDataSheet" in packageData.links) - { - link = packageData.links["technicalDataSheet"] - } - return link - } - property var safetyDataSheetUrl: - { - var sds_name = "safetyDataSheet" - return (sds_name in packageData.links) ? packageData.links[sds_name] : undefined - } - property var printingGuidelinesUrl: - { - var pg_name = "printingGuidelines" - return (pg_name in packageData.links) ? packageData.links[pg_name] : undefined - } + property var technicalDataSheetUrl: packageData.links.technicalDataSheet + property var safetyDataSheetUrl: packageData.links.safetyDataSheet + property var printingGuidelinesUrl: packageData.links.printingGuidelines + property var materialWebsiteUrl: packageData.links.website - property var materialWebsiteUrl: - { - var pg_name = "website" - return (pg_name in packageData.links) ? packageData.links[pg_name] : undefined - } - anchors.topMargin: UM.Theme.getSize("default_margin").height - height: visible ? childrenRect.height : 0 - - visible: packageData.type == "material" && - (packageData.has_configs || technicalDataSheetUrl !== undefined || - safetyDataSheetUrl !== undefined || printingGuidelinesUrl !== undefined || - materialWebsiteUrl !== undefined) + height: childrenRect.height + onVisibleChanged: packageData.type == "material" && (compatibilityItem.visible || dataSheetLinks.visible) Item { - id: combatibilityItem + id: compatibilityItem visible: packageData.has_configs width: parent.width - // This is a bit of a hack, but the whole QML is pretty messy right now. This needs a big overhaul. - height: visible ? heading.height + table.height: 0 Label { @@ -155,32 +122,32 @@ Item TableViewColumn { role: "machine" - title: "Machine" + title: catalog.i18nc("@label table header", "Machine") width: Math.floor(table.width * 0.25) delegate: columnTextDelegate } TableViewColumn { role: "print_core" - title: "Print Core" + title: catalog.i18nc("@label table header", "Print Core") width: Math.floor(table.width * 0.2) } TableViewColumn { role: "build_plate" - title: "Build Plate" + title: catalog.i18nc("@label table header", "Build Plate") width: Math.floor(table.width * 0.225) } TableViewColumn { role: "support_material" - title: "Support" + title: catalog.i18nc("@label table header", "Support") width: Math.floor(table.width * 0.225) } TableViewColumn { role: "quality" - title: "Quality" + title: catalog.i18nc("@label table header", "Quality") width: Math.floor(table.width * 0.1) } } @@ -188,13 +155,14 @@ Item Label { - id: data_sheet_links - anchors.top: combatibilityItem.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height / 2 + id: dataSheetLinks + anchors.top: parent.top + anchors.topMargin: UM.Theme.getSize("narrow_margin").height visible: base.technicalDataSheetUrl !== undefined || - base.safetyDataSheetUrl !== undefined || base.printingGuidelinesUrl !== undefined || - base.materialWebsiteUrl !== undefined - height: visible ? contentHeight : 0 + base.safetyDataSheetUrl !== undefined || + base.printingGuidelinesUrl !== undefined || + base.materialWebsiteUrl !== undefined + text: { var result = "" diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml index c7bb1f60ac..1fb6175308 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml @@ -10,21 +10,21 @@ Item { id: tile width: detailList.width - UM.Theme.getSize("wide_margin").width - height: normalData.height + compatibilityChart.height + 4 * UM.Theme.getSize("default_margin").height - Item + height: normalData.height + 2 * UM.Theme.getSize("wide_margin").height + Column { id: normalData - height: childrenRect.height + anchors { + top: parent.top left: parent.left right: controls.left - rightMargin: UM.Theme.getSize("default_margin").width * 2 + UM.Theme.getSize("toolbox_loader").width - top: parent.top + rightMargin: UM.Theme.getSize("wide_margin").width } + Label { - id: packageName width: parent.width height: UM.Theme.getSize("toolbox_property_label").height text: model.name @@ -33,9 +33,9 @@ Item font: UM.Theme.getFont("medium_bold") renderType: Text.NativeRendering } + Label { - anchors.top: packageName.bottom width: parent.width text: model.description maximumLineCount: 25 @@ -45,6 +45,12 @@ Item font: UM.Theme.getFont("default") renderType: Text.NativeRendering } + + ToolboxCompatibilityChart + { + width: parent.width + packageData: model + } } ToolboxDetailTileActions @@ -57,20 +63,12 @@ Item packageData: model } - ToolboxCompatibilityChart - { - id: compatibilityChart - anchors.top: normalData.bottom - width: normalData.width - packageData: model - } - Rectangle { color: UM.Theme.getColor("lining") width: tile.width height: UM.Theme.getSize("default_lining").height - anchors.top: compatibilityChart.bottom + anchors.top: normalData.bottom anchors.topMargin: UM.Theme.getSize("default_margin").height + UM.Theme.getSize("wide_margin").height //Normal margin for spacing after chart, wide margin between items. } } diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml index f50c3f3ac6..f8b4ae6dff 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml @@ -41,7 +41,7 @@ Item Column { id: pluginInfo - topPadding: Math.floor(UM.Theme.getSize("default_margin").height / 2) + topPadding: UM.Theme.getSize("narrow_margin").height property var color: model.type === "plugin" && !isEnabled ? UM.Theme.getColor("lining") : UM.Theme.getColor("text") width: Math.floor(tileRow.width - (authorInfo.width + pluginActions.width + 2 * tileRow.spacing + ((disableButton.visible) ? disableButton.width + tileRow.spacing : 0))) Label From 5c3a608e1a8156e75e4f7fcc503ed8b2152e5a05 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 7 May 2019 09:10:28 +0200 Subject: [PATCH 2/6] Small changes in the qml code for the compatibility chart --- .../qml/ToolboxCompatibilityChart.qml | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml index 770082092f..1d1344fa9a 100644 --- a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml +++ b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml @@ -17,18 +17,19 @@ Item property var materialWebsiteUrl: packageData.links.website height: childrenRect.height - onVisibleChanged: packageData.type == "material" && (compatibilityItem.visible || dataSheetLinks.visible) + onVisibleChanged: packageData.type === "material" && (compatibilityItem.visible || dataSheetLinks.visible) - Item + Column { id: compatibilityItem visible: packageData.has_configs width: parent.width + // This is a bit of a hack, but the whole QML is pretty messy right now. This needs a big overhaul. + height: visible ? heading.height + table.height: 0 Label { id: heading - anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width text: catalog.i18nc("@label", "Compatibility") wrapMode: Text.WordWrap @@ -40,8 +41,6 @@ Item TableView { id: table - anchors.top: heading.bottom - anchors.topMargin: UM.Theme.getSize("default_margin").height width: parent.width frameVisible: false @@ -122,32 +121,32 @@ Item TableViewColumn { role: "machine" - title: catalog.i18nc("@label table header", "Machine") + title: catalog.i18nc("@label:table_header", "Machine") width: Math.floor(table.width * 0.25) delegate: columnTextDelegate } TableViewColumn { role: "print_core" - title: catalog.i18nc("@label table header", "Print Core") + title: catalog.i18nc("@label:table_header", "Print Core") width: Math.floor(table.width * 0.2) } TableViewColumn { role: "build_plate" - title: catalog.i18nc("@label table header", "Build Plate") + title: catalog.i18nc("@label:table_header", "Build Plate") width: Math.floor(table.width * 0.225) } TableViewColumn { role: "support_material" - title: catalog.i18nc("@label table header", "Support") + title: catalog.i18nc("@label:table_header", "Support") width: Math.floor(table.width * 0.225) } TableViewColumn { role: "quality" - title: catalog.i18nc("@label table header", "Quality") + title: catalog.i18nc("@label:table_header", "Quality") width: Math.floor(table.width * 0.1) } } @@ -156,7 +155,7 @@ Item Label { id: dataSheetLinks - anchors.top: parent.top + anchors.top: compatibilityItem.bottom anchors.topMargin: UM.Theme.getSize("narrow_margin").height visible: base.technicalDataSheetUrl !== undefined || base.safetyDataSheetUrl !== undefined || From 3390cca2d9ac668f4a1798c0b13932639680a3d1 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 7 May 2019 09:31:56 +0200 Subject: [PATCH 3/6] Clean up the ToolboxProgressButton --- .../qml/ToolboxDetailTileActions.qml | 2 +- .../resources/qml/ToolboxProgressButton.qml | 71 +++++++++---------- 2 files changed, 33 insertions(+), 40 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml index 2b86aacefc..dfe91edbf6 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTileActions.qml @@ -35,7 +35,7 @@ Column // Don't allow installing while another download is running enabled: installed || (!(toolbox.isDownloading && toolbox.activePackage != model) && !loginRequired) opacity: enabled ? 1.0 : 0.5 - visible: !updateButton.visible && !installed// Don't show when the update button is visible + visible: !updateButton.visible && !installed // Don't show when the update button is visible } Cura.SecondaryButton diff --git a/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml b/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml index 4d4ae92e73..40d6c1af47 100644 --- a/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml +++ b/plugins/Toolbox/resources/qml/ToolboxProgressButton.qml @@ -1,16 +1,16 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2019 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick 2.10 +import QtQuick.Controls 2.3 + import UM 1.1 as UM import Cura 1.0 as Cura -Item +Cura.PrimaryButton { - id: base + id: button property var active: false property var complete: false @@ -25,43 +25,36 @@ Item width: UM.Theme.getSize("toolbox_action_button").width height: UM.Theme.getSize("toolbox_action_button").height - - Cura.PrimaryButton + fixedWidthMode: true + text: { - id: button - width: UM.Theme.getSize("toolbox_action_button").width - height: UM.Theme.getSize("toolbox_action_button").height - fixedWidthMode: true - text: + if (complete) { - if (complete) - { - return completeLabel - } - else if (active) - { - return activeLabel - } - else - { - return readyLabel - } + return completeLabel } - onClicked: + else if (active) { - if (complete) - { - completeAction() - } - else if (active) - { - activeAction() - } - else - { - readyAction() - } + return activeLabel + } + else + { + return readyLabel } - busy: active } + onClicked: + { + if (complete) + { + completeAction() + } + else if (active) + { + activeAction() + } + else + { + readyAction() + } + } + busy: active } From 39aa5fedf5cf6a10384f539af75d80845c57b2c8 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 7 May 2019 10:50:59 +0200 Subject: [PATCH 4/6] Update some widgets to Qt Controls 2 The ScrollView generated some wobbling text (mainly in macOS) --- plugins/Toolbox/resources/qml/Toolbox.qml | 12 ++++++------ .../resources/qml/ToolboxDetailList.qml | 12 +++++------- .../resources/qml/ToolboxDetailTile.qml | 6 +++--- .../resources/qml/ToolboxDownloadsPage.qml | 19 +++++++------------ .../resources/qml/ToolboxInstalledPage.qml | 11 +++-------- 5 files changed, 24 insertions(+), 36 deletions(-) diff --git a/plugins/Toolbox/resources/qml/Toolbox.qml b/plugins/Toolbox/resources/qml/Toolbox.qml index d15d98eed7..f70dab03d8 100644 --- a/plugins/Toolbox/resources/qml/Toolbox.qml +++ b/plugins/Toolbox/resources/qml/Toolbox.qml @@ -48,32 +48,32 @@ Window ToolboxLoadingPage { id: viewLoading - visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "loading" + visible: toolbox.viewCategory !== "installed" && toolbox.viewPage === "loading" } ToolboxErrorPage { id: viewErrored - visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "errored" + visible: toolbox.viewCategory !== "installed" && toolbox.viewPage === "errored" } ToolboxDownloadsPage { id: viewDownloads - visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "overview" + visible: toolbox.viewCategory !== "installed" && toolbox.viewPage === "overview" } ToolboxDetailPage { id: viewDetail - visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "detail" + visible: toolbox.viewCategory !== "installed" && toolbox.viewPage === "detail" } ToolboxAuthorPage { id: viewAuthor - visible: toolbox.viewCategory != "installed" && toolbox.viewPage == "author" + visible: toolbox.viewCategory !== "installed" && toolbox.viewPage === "author" } ToolboxInstalledPage { id: installedPluginList - visible: toolbox.viewCategory == "installed" + visible: toolbox.viewCategory === "installed" } } diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailList.qml b/plugins/Toolbox/resources/qml/ToolboxDetailList.qml index 4e44ea7d0b..22c6b6045f 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailList.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailList.qml @@ -1,9 +1,8 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2019 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick 2.10 +import QtQuick.Controls 2.3 import UM 1.1 as UM Item @@ -11,10 +10,9 @@ Item id: detailList ScrollView { - frameVisible: false + clip: true anchors.fill: detailList - style: UM.Theme.styles.scrollview - flickableItem.flickableDirection: Flickable.VerticalFlick + Column { anchors diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml index 1fb6175308..5badc6b66d 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml @@ -1,9 +1,9 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2019 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.3 + import UM 1.1 as UM Item diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml index 3e0dda4f4a..5ea24d17ba 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml @@ -1,25 +1,20 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2019 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.7 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick 2.10 +import QtQuick.Controls 2.3 import UM 1.1 as UM ScrollView { - frameVisible: false + clip: true width: parent.width height: parent.height - style: UM.Theme.styles.scrollview - - flickableItem.flickableDirection: Flickable.VerticalFlick Column { width: base.width spacing: UM.Theme.getSize("default_margin").height - height: childrenRect.height ToolboxDownloadsShowcase { @@ -31,14 +26,14 @@ ScrollView { id: allPlugins width: parent.width - heading: toolbox.viewCategory == "material" ? catalog.i18nc("@label", "Community Contributions") : catalog.i18nc("@label", "Community Plugins") - model: toolbox.viewCategory == "material" ? toolbox.materialsAvailableModel : toolbox.pluginsAvailableModel + heading: toolbox.viewCategory === "material" ? catalog.i18nc("@label", "Community Contributions") : catalog.i18nc("@label", "Community Plugins") + model: toolbox.viewCategory === "material" ? toolbox.materialsAvailableModel : toolbox.pluginsAvailableModel } ToolboxDownloadsGrid { id: genericMaterials - visible: toolbox.viewCategory == "material" + visible: toolbox.viewCategory === "material" width: parent.width heading: catalog.i18nc("@label", "Generic Materials") model: toolbox.materialsGenericModel diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml index 0c43c67679..46ed549b7e 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml @@ -1,22 +1,17 @@ -// Copyright (c) 2018 Ultimaker B.V. +// Copyright (c) 2019 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Dialogs 1.1 -import QtQuick.Window 2.2 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 +import QtQuick.Controls 2.3 import UM 1.1 as UM ScrollView { id: page - frameVisible: false + clip: true width: parent.width height: parent.height - style: UM.Theme.styles.scrollview - flickableItem.flickableDirection: Flickable.VerticalFlick Column { From a62f4eb1d2bfa3f95176cbc5a4aa401e0df2a3e3 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Thu, 9 May 2019 17:04:27 +0200 Subject: [PATCH 5/6] Fix padding in the installed tab --- .../resources/qml/ToolboxDownloadsGrid.qml | 4 +--- .../resources/qml/ToolboxDownloadsPage.qml | 1 + .../resources/qml/ToolboxInstalledPage.qml | 21 ++++++++----------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml index a9fcb39b28..6682281a31 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGrid.qml @@ -2,9 +2,7 @@ // Toolbox is released under the terms of the LGPLv3 or higher. import QtQuick 2.10 -import QtQuick.Controls 1.4 -import QtQuick.Controls.Styles 1.4 -import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.3 import UM 1.1 as UM Column diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml index 5ea24d17ba..c9bb74afea 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml @@ -7,6 +7,7 @@ import UM 1.1 as UM ScrollView { + id: base clip: true width: parent.width height: parent.height diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml index 46ed549b7e..1079331185 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml @@ -15,31 +15,26 @@ ScrollView Column { + width: page.width spacing: UM.Theme.getSize("default_margin").height + padding: UM.Theme.getSize("wide_margin").width visible: toolbox.pluginsInstalledModel.items.length > 0 - height: childrenRect.height + 4 * UM.Theme.getSize("default_margin").height - - anchors - { - right: parent.right - left: parent.left - margins: UM.Theme.getSize("default_margin").width - top: parent.top - } + height: childrenRect.height + 2 * UM.Theme.getSize("wide_margin").height Label { - width: page.width + width: parent.width - 2 * parent.padding text: catalog.i18nc("@title:tab", "Plugins") color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("large") renderType: Text.NativeRendering } + Rectangle { id: installedPlugins color: "transparent" - width: parent.width + width: parent.width - 2 * parent.padding height: childrenRect.height + UM.Theme.getSize("default_margin").width border.color: UM.Theme.getColor("lining") border.width: UM.Theme.getSize("default_lining").width @@ -60,8 +55,10 @@ ScrollView } } } + Label { + width: parent.width - 2 * parent.padding text: catalog.i18nc("@title:tab", "Materials") color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") @@ -72,7 +69,7 @@ ScrollView { id: installedMaterials color: "transparent" - width: parent.width + width: parent.width - 2 * parent.padding height: childrenRect.height + UM.Theme.getSize("default_margin").width border.color: UM.Theme.getColor("lining") border.width: UM.Theme.getSize("default_lining").width From 46e6baf6aef01d63e3e9fb8f7046798285f4e46b Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Tue, 23 Jul 2019 16:17:54 +0200 Subject: [PATCH 6/6] Make suggested changes Add anchors instead of using width Contributes to CURA-6518. --- .../resources/qml/ToolboxDownloadsPage.qml | 1 - .../resources/qml/ToolboxInstalledPage.qml | 28 ++++++++++++++++--- 2 files changed, 24 insertions(+), 5 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml index c9bb74afea..5ea24d17ba 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsPage.qml @@ -7,7 +7,6 @@ import UM 1.1 as UM ScrollView { - id: base clip: true width: parent.width height: parent.height diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml index 1079331185..f4a9e634c4 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledPage.qml @@ -23,7 +23,12 @@ ScrollView Label { - width: parent.width - 2 * parent.padding + anchors + { + left: parent.left + right: parent.right + margins: parent.padding + } text: catalog.i18nc("@title:tab", "Plugins") color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("large") @@ -32,9 +37,14 @@ ScrollView Rectangle { + anchors + { + left: parent.left + right: parent.right + margins: parent.padding + } id: installedPlugins color: "transparent" - width: parent.width - 2 * parent.padding height: childrenRect.height + UM.Theme.getSize("default_margin").width border.color: UM.Theme.getColor("lining") border.width: UM.Theme.getSize("default_lining").width @@ -58,7 +68,12 @@ ScrollView Label { - width: parent.width - 2 * parent.padding + anchors + { + left: parent.left + right: parent.right + margins: parent.padding + } text: catalog.i18nc("@title:tab", "Materials") color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("medium") @@ -67,9 +82,14 @@ ScrollView Rectangle { + anchors + { + left: parent.left + right: parent.right + margins: parent.padding + } id: installedMaterials color: "transparent" - width: parent.width - 2 * parent.padding height: childrenRect.height + UM.Theme.getSize("default_margin").width border.color: UM.Theme.getColor("lining") border.width: UM.Theme.getSize("default_lining").width