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:
parent
b2786508e1
commit
cee709d054
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user