Browse Source

Revert "Revert "Add new button to open the Marketplace""

This reverts commit aa4b7ddb8bce12c4ff2ea8864c1dad63a7a0a7c4.
Apparently it is now in scope again for the button to be there. It's in the requirements and the requirements are holy. Whoopteedoo.

Contributes to issue CURA-8556.
Ghostkeeper 3 years ago
parent
commit
7796abd55b
1 changed files with 34 additions and 4 deletions
  1. 34 4
      resources/qml/MainWindow/MainWindowHeader.qml

+ 34 - 4
resources/qml/MainWindow/MainWindowHeader.qml

@@ -86,7 +86,6 @@ Item
     // Shortcut button to quick access the Toolbox
     Controls2.Button
     {
-        id: marketplaceButton
         text: catalog.i18nc("@action:button", "Marketplace")
         height: Math.round(0.5 * UM.Theme.getSize("main_window_header").height)
         onClicked: Cura.Actions.browsePackages.trigger()
@@ -107,7 +106,7 @@ Item
                 anchors.fill: parent
                 radius: parent.radius
                 color: UM.Theme.getColor("primary_text")
-                opacity: marketplaceButton.hovered ? 0.2 : 0
+                opacity: parent.hovered ? 0.2 : 0
                 Behavior on opacity { NumberAnimation { duration: 100 } }
             }
         }
@@ -115,7 +114,7 @@ Item
         contentItem: Label
         {
             id: label
-            text: marketplaceButton.text
+            text: parent.text
             font: UM.Theme.getFont("default")
             color: UM.Theme.getColor("primary_text")
             width: contentWidth
@@ -125,7 +124,7 @@ Item
 
         anchors
         {
-            right: applicationSwitcher.left
+            right: marketplaceButton.left
             rightMargin: UM.Theme.getSize("default_margin").width
             verticalCenter: parent.verticalCenter
         }
@@ -150,6 +149,37 @@ 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.browsePackages.trigger()
+    }
+
     ApplicationSwitcher
     {
         id: applicationSwitcher