Browse Source

Add Toolbox shortcut to the TopHeader and align the stage tabs to the
center.

Contributes to CURA-5784.

Diego Prado Gesto 6 years ago
parent
commit
41add97b13

+ 0 - 13
resources/qml/Cura.qml

@@ -422,19 +422,6 @@ UM.MainWindow
         }
     }
 
-    UM.ExtensionModel {
-        id: curaExtensions
-    }
-
-    // show the plugin browser dialog
-    Connections
-    {
-        target: Cura.Actions.browsePackages
-        onTriggered: {
-            curaExtensions.callExtensionMethod("Toolbox", "browsePackages")
-        }
-    }
-
     Timer
     {
         id: createProfileTimer

+ 24 - 3
resources/qml/Skeleton/ApplicationMenu.qml

@@ -180,7 +180,7 @@ Item
 
         Menu
         {
-            id: extension_menu
+            id: extensionMenu
             title: catalog.i18nc("@title:menu menubar:toplevel","E&xtensions")
 
             Instantiator
@@ -207,8 +207,8 @@ Item
                     }
                 }
 
-                onObjectAdded: extension_menu.insertItem(index, object)
-                onObjectRemoved: extension_menu.removeItem(object)
+                onObjectAdded: extensionMenu.insertItem(index, object)
+                onObjectRemoved: extensionMenu.removeItem(object)
             }
         }
 
@@ -241,6 +241,10 @@ Item
         }
     }
 
+    // ###############################################################################################
+    // Definition of other components that are linked to the menus
+    // ###############################################################################################
+
     WorkspaceSummaryDialog
     {
         id: saveWorkspaceDialog
@@ -263,6 +267,14 @@ Item
         }
     }
 
+    UM.ExtensionModel {
+        id: curaExtensions
+    }
+
+    // ###############################################################################################
+    // Definition of all the connections
+    // ###############################################################################################
+
     Connections
     {
         target: Cura.Actions.newProject
@@ -274,4 +286,13 @@ Item
             }
         }
     }
+
+    // show the plugin browser dialog
+    Connections
+    {
+        target: Cura.Actions.browsePackages
+        onTriggered: {
+            curaExtensions.callExtensionMethod("Toolbox", "browsePackages")
+        }
+    }
 }

+ 22 - 4
resources/qml/Skeleton/TopHeader.qml

@@ -33,15 +33,19 @@ Rectangle
 
     Row
     {
-        id: stagesMenuContainer
-        anchors.left: logo.right
-        anchors.leftMargin: UM.Theme.getSize("topheader_logo_right_margin").width
+        id: stagesListContainer
+
+        anchors
+        {
+            horizontalCenter: parent.horizontalCenter
+            leftMargin: UM.Theme.getSize("default_margin").width
+        }
         spacing: UM.Theme.getSize("default_margin").width
 
         // The topheader is dynamically filled with all available stages
         Repeater
         {
-            id: stagesMenu
+            id: stagesHeader
 
             model: UM.StageModel { }
 
@@ -63,4 +67,18 @@ Rectangle
 
         ExclusiveGroup { id: topheaderMenuGroup }
     }
+
+    // Shortcut button to quick access the Toolbox
+    Button
+    {
+        id: toolboxShortcutButton
+        text: catalog.i18nc("@action:button", "Toolbox")
+        anchors
+        {
+            right: parent.right
+            leftMargin: UM.Theme.getSize("default_margin").width
+        }
+        style: UM.Theme.styles.topheader_tab
+        action: Cura.Actions.browsePackages
+    }
 }

+ 0 - 1
resources/themes/cura-light/theme.json

@@ -336,7 +336,6 @@
         "window_minimum_size": [70, 50],
 
         "topheader": [0.0, 4.0],
-        "topheader_logo_right_margin": [3, 0],
         "topheader_button": [8, 4],
         "topheader_button_icon": [1.2, 1.2],