diff --git a/src/declarativeimports/plasmastyle/ButtonStyle.qml b/src/declarativeimports/plasmastyle/ButtonStyle.qml index febec70fe..a96251293 100644 --- a/src/declarativeimports/plasmastyle/ButtonStyle.qml +++ b/src/declarativeimports/plasmastyle/ButtonStyle.qml @@ -32,13 +32,14 @@ import "private" as Private QtQuickControlStyle.ButtonStyle { id: style + //this is the minimum size that can hold the entire contents property int minimumWidth property int minimumHeight label: RowLayout { spacing: units.smallSpacing - property real minimumWidth: Layout.minimumWidth + style.padding.left + style.padding.right + property real minimumWidth: implicitWidth + style.padding.left + style.padding.right onMinimumWidthChanged: { if (control.minimumWidth !== undefined) { style.minimumWidth = minimumWidth; @@ -46,7 +47,7 @@ QtQuickControlStyle.ButtonStyle { } } - property real minimumHeight: Layout.preferredHeight + style.padding.top + style.padding.bottom + property real minimumHeight: implicitHeight + style.padding.top + style.padding.bottom onMinimumHeightChanged: { if (control.minimumHeight !== undefined) { style.minimumHeight = minimumHeight; diff --git a/tests/components/button.qml b/tests/components/button.qml index fdfc42d58..a645537ab 100644 --- a/tests/components/button.qml +++ b/tests/components/button.qml @@ -7,7 +7,7 @@ import QtQuick.Layouts 1.2 Rectangle { width: 500 - height: 300 + height: 500 color: "white" Grid { @@ -107,6 +107,17 @@ Rectangle } } + Label { + text: "minimum width property. Should be two letters wide" + } + + RowLayout { + PlasmaComponents.Button { + text: "AA" + implicitWidth: minimumWidth + } + } + } }