use anchors instead of fillHeight

since the vertical size hints of the button depend from the
labe size hints, it cannot have Layout.fillHeight as it
breaks its Layout.*Height and implicitHeight
use a vertical anchor instead as buttons always have a single line

reviewed-by:d_ed
This commit is contained in:
Marco Martin 2017-02-08 13:36:14 +01:00
parent b2786508e1
commit cee709d054
2 changed files with 2 additions and 4 deletions

View File

@ -71,14 +71,13 @@ QtQuickControlStyle.ButtonStyle {
PlasmaComponents.Label {
id: label
anchors.verticalCenter: parent.verticalCenter
text: QtQuickControlsPrivate.StyleHelpers.stylizeMnemonics(control.text)
font: control.font || theme.defaultFont
visible: control.text != ""
Layout.fillWidth: true
Layout.fillHeight: true
color: theme.buttonTextColor
horizontalAlignment: icon.valid ? Text.AlignLeft : Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}

View File

@ -85,15 +85,14 @@ QtQuickControlStyle.ButtonStyle {
PlasmaComponents.Label {
id: label
anchors.verticalCenter: parent.verticalCenter
Layout.minimumWidth: implicitWidth
text: QtQuickControlsPrivate.StyleHelpers.stylizeMnemonics(control.text)
font: control.font || theme.defaultFont
visible: control.text != ""
Layout.fillWidth: true
Layout.fillHeight: true
color: controlHovered || !flat ? theme.buttonTextColor : PlasmaCore.ColorScope.textColor
horizontalAlignment: icon.valid ? Text.AlignLeft : Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
elide: Text.ElideRight
}