From ef436cafbb166e107f9fa90b1488d54a3ef98b89 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 2 May 2018 16:13:02 +0200 Subject: [PATCH 01/14] Improve thumbnail rendering --- plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index e0e25982db..9e1a7c5a86 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 +import QtQuick 2.3 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import QtQuick.Layouts 1.3 @@ -38,6 +38,7 @@ Item height: UM.Theme.getSize("toolbox_thumbnail_small").height - 26 fillMode: Image.PreserveAspectFit source: model.icon_url || "../images/logobot.svg" + mipmap: true } } Column From 3d0a0da035c5199c26c52a68530772e6d149e00b Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 2 May 2018 16:22:19 +0200 Subject: [PATCH 02/14] Fix text rendering on some OSX systems --- plugins/Toolbox/resources/qml/ToolboxFooter.qml | 2 +- plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml | 2 +- plugins/Toolbox/resources/qml/ToolboxTabButton.qml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxFooter.qml b/plugins/Toolbox/resources/qml/ToolboxFooter.qml index 098a52d49a..b83d14a08b 100644 --- a/plugins/Toolbox/resources/qml/ToolboxFooter.qml +++ b/plugins/Toolbox/resources/qml/ToolboxFooter.qml @@ -49,7 +49,7 @@ Item implicitHeight: Math.floor(UM.Theme.getSize("toolbox_footer_button").height) color: control.hovered ? UM.Theme.getColor("primary_hover") : UM.Theme.getColor("primary") } - label: Text + label: Label { color: UM.Theme.getColor("button_text") font: UM.Theme.getFont("default_bold") diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml index ff27e004b2..2389cca7e7 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml @@ -130,7 +130,7 @@ Item color: UM.Theme.getColor("lining") } } - label: Text + label: Label { text: control.text color: UM.Theme.getColor("text") diff --git a/plugins/Toolbox/resources/qml/ToolboxTabButton.qml b/plugins/Toolbox/resources/qml/ToolboxTabButton.qml index a61e77d241..0f759c75fb 100644 --- a/plugins/Toolbox/resources/qml/ToolboxTabButton.qml +++ b/plugins/Toolbox/resources/qml/ToolboxTabButton.qml @@ -25,7 +25,7 @@ Button height: UM.Theme.getSize("sidebar_header_highlight").height } } - label: Text + label: Label { text: control.text color: From a3436bb24b0fb50eef089f070844f9928b765940 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 2 May 2018 16:25:27 +0200 Subject: [PATCH 03/14] Fix title color on dark theme --- plugins/Toolbox/resources/qml/ToolboxDetailPage.qml | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 5a73bcc981..98cc396f91 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -56,6 +56,7 @@ Item } text: details.name font: UM.Theme.getFont("large") + color: UM.Theme.getColor("text") wrapMode: Text.WordWrap width: parent.width height: UM.Theme.getSize("toolbox_property_label").height From 132a1a19513aabbb395b07275eae39a92937cc96 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 2 May 2018 17:20:15 +0200 Subject: [PATCH 04/14] Fix binding loop errors --- plugins/Toolbox/resources/qml/ToolboxDetailTile.qml | 2 +- .../Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml index 6bad12236b..82b973609f 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml @@ -11,7 +11,7 @@ Item id: tile property bool installed: toolbox.isInstalled(model.id) width: detailList.width - UM.Theme.getSize("wide_margin").width - height: Math.max(UM.Theme.getSize("toolbox_detail_tile").height, childrenRect.height + UM.Theme.getSize("default_margin").height) + height: normalData.height + supportedConfigsChart.height + 3 * UM.Theme.getSize("default_margin").height Item { id: normalData diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml index a699e9dae6..d6ba984774 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml @@ -9,7 +9,7 @@ import UM 1.1 as UM Item { width: UM.Theme.getSize("toolbox_thumbnail_large").width - height: childrenRect.height + height: thumbnail.height + packageName.height Rectangle { id: highlight @@ -44,10 +44,11 @@ Item } Label { + id: packageName text: model.name anchors { - bottom: parent.bottom + top: thumbnail.bottom horizontalCenter: parent.horizontalCenter } verticalAlignment: Text.AlignVCenter From ecbfae2f27523dacbbe2d7ec9c4f8125ac560f28 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 2 May 2018 17:22:00 +0200 Subject: [PATCH 05/14] Remove minimise button from toolbox dialog --- plugins/Toolbox/resources/qml/Toolbox.qml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/plugins/Toolbox/resources/qml/Toolbox.qml b/plugins/Toolbox/resources/qml/Toolbox.qml index cdbe2f0710..f7784ec7ce 100644 --- a/plugins/Toolbox/resources/qml/Toolbox.qml +++ b/plugins/Toolbox/resources/qml/Toolbox.qml @@ -12,6 +12,8 @@ Window property var selection: null title: catalog.i18nc("@title", "Toolbox") modality: Qt.ApplicationModal + flags: Qt.Dialog | Qt.CustomizeWindowHint | Qt.WindowTitleHint | Qt.WindowCloseButtonHint + width: 720 * screenScaleFactor height: 640 * screenScaleFactor minimumWidth: 720 * screenScaleFactor From d326e91008dc246494360421ba3ecdd02333096c Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 2 May 2018 17:54:48 +0200 Subject: [PATCH 06/14] Fix dpi scaling --- plugins/Toolbox/resources/qml/ToolboxDetailTile.qml | 4 ++-- plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml index 82b973609f..3888b314e0 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml @@ -79,8 +79,8 @@ Item { background: Rectangle { - implicitWidth: 96 - implicitHeight: 30 + implicitWidth: 96 * screenScaleFactor + implicitHeight: 30 * screenScaleFactor color: { if (installed) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index 9e1a7c5a86..b1586e5c52 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -34,8 +34,8 @@ Item Image { anchors.centerIn: parent - width: UM.Theme.getSize("toolbox_thumbnail_small").width - 26 - height: UM.Theme.getSize("toolbox_thumbnail_small").height - 26 + width: UM.Theme.getSize("toolbox_thumbnail_small").width - UM.Theme.getSize("default_margin").width + height: UM.Theme.getSize("toolbox_thumbnail_small").height - UM.Theme.getSize("default_margin").width fillMode: Image.PreserveAspectFit source: model.icon_url || "../images/logobot.svg" mipmap: true From 1f542f176d4d42fe2d8a12f90f4e27e0f02676d9 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 2 May 2018 19:18:03 +0200 Subject: [PATCH 07/14] Fix some more image rendering occurrences --- plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml | 3 ++- plugins/Toolbox/resources/qml/ToolboxDetailPage.qml | 3 ++- plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml index 6c87f9d2e2..06801b068a 100644 --- a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 +import QtQuick 2.3 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -32,6 +32,7 @@ Item height: UM.Theme.getSize("toolbox_thumbnail_medium").height fillMode: Image.PreserveAspectFit source: details.icon_url || "../images/logobot.svg" + mipmap: true anchors { top: parent.top diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 98cc396f91..6af1c2e76e 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 +import QtQuick 2.3 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -33,6 +33,7 @@ Item height: UM.Theme.getSize("toolbox_thumbnail_medium").height fillMode: Image.PreserveAspectFit source: details.icon_url || "../images/logobot.svg" + mipmap: true anchors { top: parent.top diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml index d6ba984774..f665404df7 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsShowcaseTile.qml @@ -1,7 +1,7 @@ // Copyright (c) 2018 Ultimaker B.V. // Toolbox is released under the terms of the LGPLv3 or higher. -import QtQuick 2.2 +import QtQuick 2.3 import QtQuick.Controls 1.4 import QtQuick.Controls.Styles 1.4 import UM 1.1 as UM @@ -40,6 +40,7 @@ Item height: UM.Theme.getSize("toolbox_thumbnail_large").height - 2 * UM.Theme.getSize("default_margin").height fillMode: Image.PreserveAspectFit source: model.icon_url || "../images/logobot.svg" + mipmap: true } } Label From 46e7a6665d0f314e922a86ae4c7cbd3d61d8c475 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 2 May 2018 19:20:52 +0200 Subject: [PATCH 08/14] Theme link colors --- plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml | 1 + plugins/Toolbox/resources/qml/ToolboxDetailPage.qml | 1 + plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml | 1 + 3 files changed, 3 insertions(+) diff --git a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml index 06801b068a..3858e2c122 100644 --- a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml @@ -115,6 +115,7 @@ Item } font: UM.Theme.getFont("very_small") color: UM.Theme.getColor("text") + linkColor: UM.Theme.getColor("text_link") onLinkActivated: Qt.openUrlExternally(link) } } diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index 6af1c2e76e..cee06bf9e2 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -135,6 +135,7 @@ Item } font: UM.Theme.getFont("very_small") color: UM.Theme.getColor("text") + linkColor: UM.Theme.getColor("text_link") onLinkActivated: Qt.openUrlExternally(link) } } diff --git a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml index 2389cca7e7..0ed71845f5 100644 --- a/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxInstalledTile.qml @@ -89,6 +89,7 @@ Item horizontalAlignment: Text.AlignLeft onLinkActivated: Qt.openUrlExternally("mailto:" + model.author_email + "?Subject=Cura: " + model.name + " Plugin") color: model.enabled ? UM.Theme.getColor("text") : UM.Theme.getColor("lining") + linkColor: UM.Theme.getColor("text_link") } } Column From ca8b7bb1da1352336ef13a3a78f5e021cde588c2 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 2 May 2018 20:34:50 +0200 Subject: [PATCH 09/14] Fix QML warnings --- plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml | 6 +++--- plugins/Toolbox/resources/qml/ToolboxDetailPage.qml | 6 +++--- plugins/Toolbox/resources/qml/ToolboxLicenseDialog.qml | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml index 3858e2c122..04b055ed66 100644 --- a/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxAuthorPage.qml @@ -9,7 +9,7 @@ import UM 1.1 as UM Item { id: page - property var details: base.selection + property var details: base.selection || {} anchors.fill: parent ToolboxBackColumn { @@ -54,7 +54,7 @@ Item rightMargin: UM.Theme.getSize("wide_margin").width bottomMargin: UM.Theme.getSize("default_margin").height } - text: details.name + text: details.name || "" font: UM.Theme.getFont("large") wrapMode: Text.WordWrap width: parent.width @@ -63,7 +63,7 @@ Item Label { id: description - text: details.description + text: details.description || "" anchors { top: title.bottom diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index cee06bf9e2..c1419fb620 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -9,7 +9,7 @@ import UM 1.1 as UM Item { id: page - property var details: base.selection + property var details: base.selection || {} anchors.fill: parent width: parent.width ToolboxBackColumn @@ -55,7 +55,7 @@ Item rightMargin: UM.Theme.getSize("wide_margin").width bottomMargin: UM.Theme.getSize("default_margin").height } - text: details.name + text: details.name || "" font: UM.Theme.getFont("large") color: UM.Theme.getColor("text") wrapMode: Text.WordWrap @@ -106,7 +106,7 @@ Item spacing: Math.floor(UM.Theme.getSize("narrow_margin").height) Label { - text: details.version + text: details.version || "" font: UM.Theme.getFont("very_small") color: UM.Theme.getColor("text") } diff --git a/plugins/Toolbox/resources/qml/ToolboxLicenseDialog.qml b/plugins/Toolbox/resources/qml/ToolboxLicenseDialog.qml index 33bc466d29..b8baf7bc83 100644 --- a/plugins/Toolbox/resources/qml/ToolboxLicenseDialog.qml +++ b/plugins/Toolbox/resources/qml/ToolboxLicenseDialog.qml @@ -42,7 +42,7 @@ UM.Dialog anchors.right: parent.right anchors.topMargin: UM.Theme.getSize("default_margin").height readOnly: true - text: licenseDialog.licenseContent + text: licenseDialog.licenseContent || "" } } rightButtons: From 685b80fc3af65a54249147b2ab08afd28ea083d6 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 2 May 2018 21:56:23 +0200 Subject: [PATCH 10/14] Fix more QML warnings --- .../resources/qml/ToolboxCompatibilityChart.qml | 12 ++++++------ plugins/Toolbox/resources/qml/ToolboxDetailTile.qml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml index 1c58b46b96..4f5589d8d0 100644 --- a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml +++ b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml @@ -36,8 +36,8 @@ Item Label { anchors.verticalCenter: parent.verticalCenter - elide: styleData.elideMode - text: styleData.value + elide: styleData.elideMode || Text.ElideNone + text: styleData.value || "" color: UM.Theme.getColor("text") font: UM.Theme.getFont("default_bold") } @@ -55,8 +55,8 @@ Item Label { anchors.verticalCenter: parent.verticalCenter - elide: styleData.elideMode - text: styleData.value + elide: styleData.elideMode || Text.ElideNone + text: styleData.value || "" color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("default") } @@ -67,8 +67,8 @@ Item Label { anchors.verticalCenter: parent.verticalCenter - elide: styleData.elideMode - text: styleData.value + elide: styleData.elideMode || Text.ElideNone + text: styleData.value || "" color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("default") } diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml index e93fdb646f..b50a7466e4 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml @@ -12,7 +12,7 @@ Item property bool installed: toolbox.isInstalled(model.id) property var packageData: model width: detailList.width - UM.Theme.getSize("wide_margin").width - height: normalData.height + supportedConfigsChart.height + 3 * UM.Theme.getSize("default_margin").height + height: normalData.height + compatibilityChart.height + 3 * UM.Theme.getSize("default_margin").height Item { id: normalData From c2c5228eeee985dca0f4d5b153679caa5234afb7 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Wed, 2 May 2018 23:19:13 +0200 Subject: [PATCH 11/14] Fix plugin details Previous fix for QML warnings broke the details display. --- plugins/Toolbox/resources/qml/ToolboxDetailPage.qml | 2 +- plugins/Toolbox/resources/qml/ToolboxDetailTile.qml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml index c35b9ff618..d57acac52d 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailPage.qml @@ -9,7 +9,7 @@ import UM 1.1 as UM Item { id: page - property var details: base.selection || {} + property var details: base.selection anchors.fill: parent width: parent.width ToolboxBackColumn diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml index b50a7466e4..a5982f8c43 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml @@ -12,7 +12,7 @@ Item property bool installed: toolbox.isInstalled(model.id) property var packageData: model width: detailList.width - UM.Theme.getSize("wide_margin").width - height: normalData.height + compatibilityChart.height + 3 * UM.Theme.getSize("default_margin").height + height: normalData.height + compatibilityChart.height + 4 * UM.Theme.getSize("default_margin").height Item { id: normalData From 89322b9db6d69ea7916e95fedcfe70079ba31da9 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Fri, 4 May 2018 10:41:45 +0200 Subject: [PATCH 12/14] Move toolbox button style into theme --- .../resources/qml/ToolboxDetailTile.qml | 53 +----------------- resources/themes/cura-light/styles.qml | 55 +++++++++++++++++++ resources/themes/cura-light/theme.json | 3 +- 3 files changed, 59 insertions(+), 52 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml index a5982f8c43..7056cb3777 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDetailTile.qml @@ -76,58 +76,9 @@ Item } enabled: installed || !(toolbox.isDownloading && toolbox.activePackage != model) //Don't allow installing while another download is running. opacity: enabled ? 1.0 : 0.5 - style: ButtonStyle - { - background: Rectangle - { - implicitWidth: 96 * screenScaleFactor - implicitHeight: 30 * screenScaleFactor - color: - { - if (installed) - { - return UM.Theme.getColor("action_button_disabled") - } - else - { - if ( control.hovered ) - { - return UM.Theme.getColor("primary_hover") - } - else - { - return UM.Theme.getColor("primary") - } - } - } - } - label: Label - { - text: control.text - color: - { - if (installed) - { - return UM.Theme.getColor("action_button_disabled_text") - } - else - { - if ( control.hovered ) - { - return UM.Theme.getColor("button_text_hover") - } - else - { - return UM.Theme.getColor("button_text") - } - } - } - verticalAlignment: Text.AlignVCenter - horizontalAlignment: Text.AlignHCenter - font: UM.Theme.getFont("default_bold") - } - } + property alias installed: tile.installed + style: UM.Theme.styles.toolbox_action_button onClicked: { if (installed) diff --git a/resources/themes/cura-light/styles.qml b/resources/themes/cura-light/styles.qml index 6b454b7cf1..14e7d196a7 100755 --- a/resources/themes/cura-light/styles.qml +++ b/resources/themes/cura-light/styles.qml @@ -1033,4 +1033,59 @@ QtObject { label: Item { } } } + + property Component toolbox_action_button: Component { + ButtonStyle + { + background: Rectangle + { + implicitWidth: UM.Theme.getSize("toolbox_action_button").width + implicitHeight: UM.Theme.getSize("toolbox_action_button").height + color: + { + if (control.installed) + { + return UM.Theme.getColor("action_button_disabled") + } + else + { + if (control.hovered) + { + return UM.Theme.getColor("primary_hover") + } + else + { + return UM.Theme.getColor("primary") + } + } + + } + } + label: Label + { + text: control.text + color: + { + if (control.installed) + { + return UM.Theme.getColor("action_button_disabled_text") + } + else + { + if (control.hovered) + { + return UM.Theme.getColor("button_text_hover") + } + else + { + return UM.Theme.getColor("button_text") + } + } + } + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + font: UM.Theme.getFont("default_bold") + } + } + } } diff --git a/resources/themes/cura-light/theme.json b/resources/themes/cura-light/theme.json index c78a51a3a9..1be61b523a 100644 --- a/resources/themes/cura-light/theme.json +++ b/resources/themes/cura-light/theme.json @@ -460,6 +460,7 @@ "toolbox_header": [1.0, 4.0], "toolbox_action_button": [8.0, 2.5], "toolbox_progress_bar": [8.0, 0.5], - "toolbox_chart_row": [1.0, 2.0] + "toolbox_chart_row": [1.0, 2.0], + "toolbox_action_button": [8.0, 2.5] } } From 1f675f505f611ce3dcb8473b88aa227c36e51bc9 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Fri, 4 May 2018 10:42:03 +0200 Subject: [PATCH 13/14] Tweak margins --- plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml index b1586e5c52..17b28fe136 100644 --- a/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml +++ b/plugins/Toolbox/resources/qml/ToolboxDownloadsGridTile.qml @@ -34,8 +34,8 @@ Item Image { anchors.centerIn: parent - width: UM.Theme.getSize("toolbox_thumbnail_small").width - UM.Theme.getSize("default_margin").width - height: UM.Theme.getSize("toolbox_thumbnail_small").height - UM.Theme.getSize("default_margin").width + width: UM.Theme.getSize("toolbox_thumbnail_small").width - UM.Theme.getSize("wide_margin").width + height: UM.Theme.getSize("toolbox_thumbnail_small").height - UM.Theme.getSize("wide_margin").width fillMode: Image.PreserveAspectFit source: model.icon_url || "../images/logobot.svg" mipmap: true From 4e305079ec9a99a26fda9cfd1c2403ec005da371 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Fri, 4 May 2018 11:42:45 +0200 Subject: [PATCH 14/14] Simplify --- plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml index 4f5589d8d0..3c225c521a 100644 --- a/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml +++ b/plugins/Toolbox/resources/qml/ToolboxCompatibilityChart.qml @@ -36,7 +36,7 @@ Item Label { anchors.verticalCenter: parent.verticalCenter - elide: styleData.elideMode || Text.ElideNone + elide: Text.ElideRight text: styleData.value || "" color: UM.Theme.getColor("text") font: UM.Theme.getFont("default_bold") @@ -55,7 +55,7 @@ Item Label { anchors.verticalCenter: parent.verticalCenter - elide: styleData.elideMode || Text.ElideNone + elide: Text.ElideRight text: styleData.value || "" color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("default") @@ -67,7 +67,7 @@ Item Label { anchors.verticalCenter: parent.verticalCenter - elide: styleData.elideMode || Text.ElideNone + elide: Text.ElideRight text: styleData.value || "" color: UM.Theme.getColor("text_medium") font: UM.Theme.getFont("default")