diff options
Diffstat (limited to 'resources/qml/ActionButton.qml')
-rw-r--r-- | resources/qml/ActionButton.qml | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/resources/qml/ActionButton.qml b/resources/qml/ActionButton.qml index 62bea5df3b..1c231e5ef3 100644 --- a/resources/qml/ActionButton.qml +++ b/resources/qml/ActionButton.qml @@ -15,6 +15,7 @@ Button property bool isIconOnRightSide: false property alias iconSource: buttonIconLeft.source + property real iconSize: UM.Theme.getSize("action_button_icon").height property alias textFont: buttonText.font property alias cornerRadius: backgroundRect.radius property alias tooltip: tooltip.tooltipText @@ -109,7 +110,7 @@ Button { id: buttonIconLeft source: "" - height: visible ? UM.Theme.getSize("action_button_icon").height : 0 + height: visible ? button.iconSize : 0 width: visible ? height : 0 sourceSize.width: width sourceSize.height: height @@ -148,8 +149,8 @@ Button // Using parent.width is fine in fixedWidthMode. target: buttonText property: "width" - value: button.fixedWidthMode ? button.width - button.leftPadding - button.rightPadding - : ((maximumWidth != 0 && button.contentWidth > maximumWidth) ? maximumWidth : undefined) + value: button.fixedWidthMode ? (button.width - button.leftPadding - button.rightPadding) + : ((button.maximumWidth != 0 && button.implicitContentWidth > button.maximumWidth) ? (button.maximumWidth - (button.width - button.implicitContentWidth) * 2) : undefined) } } @@ -158,7 +159,7 @@ Button { id: buttonIconRight source: buttonIconLeft.source - height: visible ? UM.Theme.getSize("action_button_icon").height : 0 + height: visible ? button.iconSize : 0 width: visible ? height : 0 sourceSize.width: width sourceSize.height: height |