From f87f03b4a8dc95fc090d5a731a73a814179597ce Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Wed, 5 Aug 2015 18:30:08 +0200 Subject: [PATCH] Fix loop on ButtonStyle Nowadays the size of the icon is defined by the size of the button itself, and vice-versa. This patch uses the unit sizes to decide which sizes to offer. REVIEW: 124628 --- src/declarativeimports/plasmastyle/ButtonStyle.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/declarativeimports/plasmastyle/ButtonStyle.qml b/src/declarativeimports/plasmastyle/ButtonStyle.qml index ea64ba344..152d01f7b 100644 --- a/src/declarativeimports/plasmastyle/ButtonStyle.qml +++ b/src/declarativeimports/plasmastyle/ButtonStyle.qml @@ -38,7 +38,7 @@ QtQuickControlStyle.ButtonStyle { label: RowLayout { id: buttonContent spacing: units.smallSpacing - Layout.preferredHeight: Math.max(units.iconSizes.small, label.implicitHeight) + Layout.preferredHeight: Math.max(units.iconSizes.small, label.implicitHeight, icon.implicitHeight) property real minimumWidth: Layout.minimumWidth + style.padding.left + style.padding.right onMinimumWidthChanged: { @@ -60,11 +60,11 @@ QtQuickControlStyle.ButtonStyle { id: icon source: control.iconName || control.iconSource anchors.verticalCenter: parent.verticalCenter - Layout.minimumWidth: valid ? parent.height: 0 - Layout.maximumWidth: Layout.minimumWidth + Layout.minimumWidth: valid ? units.iconSizes.tiny : 0 + Layout.preferredWidth: valid ? units.iconSizes.small : 0 visible: valid Layout.minimumHeight: Layout.minimumWidth - Layout.maximumHeight: Layout.minimumWidth + Layout.preferredHeight: Layout.preferredWidth active: control.hovered colorGroup: PlasmaCore.Theme.ButtonColorGroup }