Browse Source

Setting the height of an action button now actually changes it's size

CURA-6115
Jaime van Kessel 6 years ago
parent
commit
4151050127
2 changed files with 6 additions and 3 deletions
  1. 5 2
      resources/qml/ActionButton.qml
  2. 1 1
      resources/themes/cura-light/theme.json

+ 5 - 2
resources/qml/ActionButton.qml

@@ -48,12 +48,13 @@ Button
     contentItem: Row
     {
         spacing: UM.Theme.getSize("narrow_margin").width
+        height: button.height
         //Left side icon. Only displayed if !isIconOnRightSide.
         UM.RecolorImage
         {
             id: buttonIconLeft
             source: ""
-            height: UM.Theme.getSize("action_button_icon").height
+            height: visible ? UM.Theme.getSize("action_button_icon").height : 0
             width: visible ? height : 0
             sourceSize.width: width
             sourceSize.height: height
@@ -70,9 +71,11 @@ Button
             font: UM.Theme.getFont("medium")
             visible: text != ""
             renderType: Text.NativeRendering
+            height: parent.height
             anchors.verticalCenter: parent.verticalCenter
             width: fixedWidthMode ? button.width - button.leftPadding - button.rightPadding : undefined
             horizontalAlignment: Text.AlignHCenter
+            verticalAlignment: Text.AlignVCenter
             elide: Text.ElideRight
         }
 
@@ -81,7 +84,7 @@ Button
         {
             id: buttonIconRight
             source: buttonIconLeft.source
-            height: UM.Theme.getSize("action_button_icon").height
+            height: visible ? UM.Theme.getSize("action_button_icon").height : 0
             width: visible ? height : 0
             sourceSize.width: width
             sourceSize.height: height

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

@@ -504,7 +504,7 @@
         "button_icon": [2.5, 2.5],
         "button_lining": [0, 0],
 
-        "action_button": [15.0, 3.0],
+        "action_button": [15.0, 2.0],
         "action_button_icon": [1.0, 1.0],
         "action_button_radius": [0.15, 0.15],