From 797ff9c573a8dd3b31edadc101094354536cbaa2 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Mon, 25 Oct 2021 11:07:49 +0200 Subject: [PATCH] Turn new Marketplace button into button with text instead of icon The Marketplace icon is apparently confusing to use for the Marketplace in Cura and should only be used for the website version. Contributes to issue CURA-8556. --- resources/qml/MainWindow/MainWindowHeader.qml | 77 +++++++++++-------- 1 file changed, 43 insertions(+), 34 deletions(-) diff --git a/resources/qml/MainWindow/MainWindowHeader.qml b/resources/qml/MainWindow/MainWindowHeader.qml index 48761c8c70..a47f8e963c 100644 --- a/resources/qml/MainWindow/MainWindowHeader.qml +++ b/resources/qml/MainWindow/MainWindowHeader.qml @@ -84,9 +84,9 @@ Item } // Shortcut button to quick access the Toolbox - Controls2.Button + Controls2.Button //TODO: Remove once new Marketplace is completed. { - text: catalog.i18nc("@action:button", "Marketplace") + text: "Old Marketplace" height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height) onClicked: Cura.Actions.browsePackages.trigger() @@ -128,10 +128,50 @@ Item rightMargin: UM.Theme.getSize("default_margin").width verticalCenter: parent.verticalCenter } + } + + Controls2.Button + { + id: marketplaceButton + height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height) + anchors + { + verticalCenter: parent.verticalCenter + right: applicationSwitcher.left + rightMargin: UM.Theme.getSize("default_margin").width + } + + hoverEnabled: true + onClicked: Cura.Actions.openMarketplace.trigger() + + contentItem: Label + { + text: "Marketplace" //Ultimaker considers this a product name, so it shouldn't be translated. + font: UM.Theme.getFont("default") + color: UM.Theme.getColor("primary_text") + width: contentWidth + verticalAlignment: Text.AlignVCenter + } + + background: Rectangle + { + radius: UM.Theme.getSize("action_button_radius").width + color: UM.Theme.getColor("main_window_header_background") + border.width: UM.Theme.getSize("default_lining").width + border.color: UM.Theme.getColor("primary_text") + + Rectangle + { + anchors.fill: parent + radius: parent.radius + color: UM.Theme.getColor("primary_text") + opacity: marketplaceButton.hovered ? 0.2 : 0 + Behavior on opacity { NumberAnimation { duration: 100 } } + } + } Cura.NotificationIcon { - id: marketplaceNotificationIcon anchors { top: parent.top @@ -149,37 +189,6 @@ Item } } - Controls2.Button - { - id: marketplaceButton - width: Math.round(0.5 * UM.Theme.getSize("main_window_header").height) - height: width - anchors - { - verticalCenter: parent.verticalCenter - right: applicationSwitcher.left - rightMargin: UM.Theme.getSize("default_margin").width - } - - background: UM.RecolorImage - { - anchors.fill: parent - color: UM.Theme.getColor("primary_text") - source: UM.Theme.getIcon("Shop") - - Rectangle - { - anchors.fill: parent - radius: UM.Theme.getSize("action_button_radius").width - color: UM.Theme.getColor("primary_text") - opacity: marketplaceButton.hovered ? 0.2 : 0 - Behavior on opacity { NumberAnimation { duration: 100; } } - } - } - - onClicked: Cura.Actions.openMarketplace.trigger() - } - ApplicationSwitcher { id: applicationSwitcher