Browse Source

Add "star" icon to profile dropdown when there are customised settings

Contributes to CURA-909
fieldOfView 9 years ago
parent
commit
81a015015d

+ 18 - 1
resources/qml/ProfileSetup.qml

@@ -32,8 +32,9 @@ Item{
             color: UM.Theme.getColor("text");
         }
 
-
         ToolButton {
+            property int rightMargin: customisedSettings.visible ? customisedSettings.width + UM.Theme.getSize("default_margin").width / 2 : 0
+
             id: globalProfileSelection
             text: UM.MachineManager.activeProfile
             width: parent.width/100*55
@@ -83,5 +84,21 @@ Item{
                 }
             }
         }
+        UM.SimpleButton {
+            id: customisedSettings
+
+            visible: UM.ActiveProfile.hasCustomisedValues
+            height: parent.height * 0.6
+            width: parent.height * 0.6
+
+            anchors.verticalCenter: parent.verticalCenter
+            anchors.right: parent.right
+            anchors.rightMargin: UM.Theme.getSize("setting_preferences_button_margin").width
+
+            color: hovered ? UM.Theme.getColor("setting_control_button_hover") : UM.Theme.getColor("setting_control_button");
+            iconSource: UM.Theme.getIcon("star");
+
+            onClicked: base.manageProfilesAction.trigger()
+        }
     }
 }

+ 1 - 0
resources/themes/cura/icons/star.svg

@@ -0,0 +1 @@
+<svg width="1792" height="1792" viewBox="0 0 1792 1792" xmlns="http://www.w3.org/2000/svg"><path d="M1728 647q0 22-26 48l-363 354 86 500q1 7 1 20 0 21-10.5 35.5t-30.5 14.5q-19 0-40-12l-449-236-449 236q-22 12-40 12-21 0-31.5-14.5t-10.5-35.5q0-6 2-20l86-500-364-354q-25-27-25-48 0-37 56-46l502-73 225-455q19-41 49-41t49 41l225 455 502 73q56 9 56 46z"/></svg>

+ 1 - 0
resources/themes/cura/styles.qml

@@ -34,6 +34,7 @@ QtObject {
                     anchors.left: parent.left;
                     anchors.leftMargin: Theme.getSize("setting_unit_margin").width
                     anchors.right: downArrow.left;
+                    anchors.rightMargin: control.rightMargin;
                     anchors.verticalCenter: parent.verticalCenter;
                     font: Theme.getFont("default")
                 }