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 {
|
PlasmaComponents.Label {
|
||||||
id: label
|
id: label
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
text: QtQuickControlsPrivate.StyleHelpers.stylizeMnemonics(control.text)
|
text: QtQuickControlsPrivate.StyleHelpers.stylizeMnemonics(control.text)
|
||||||
font: control.font || theme.defaultFont
|
font: control.font || theme.defaultFont
|
||||||
visible: control.text != ""
|
visible: control.text != ""
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
|
||||||
color: theme.buttonTextColor
|
color: theme.buttonTextColor
|
||||||
horizontalAlignment: icon.valid ? Text.AlignLeft : Text.AlignHCenter
|
horizontalAlignment: icon.valid ? Text.AlignLeft : Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,15 +85,14 @@ QtQuickControlStyle.ButtonStyle {
|
|||||||
|
|
||||||
PlasmaComponents.Label {
|
PlasmaComponents.Label {
|
||||||
id: label
|
id: label
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
Layout.minimumWidth: implicitWidth
|
Layout.minimumWidth: implicitWidth
|
||||||
text: QtQuickControlsPrivate.StyleHelpers.stylizeMnemonics(control.text)
|
text: QtQuickControlsPrivate.StyleHelpers.stylizeMnemonics(control.text)
|
||||||
font: control.font || theme.defaultFont
|
font: control.font || theme.defaultFont
|
||||||
visible: control.text != ""
|
visible: control.text != ""
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
|
||||||
color: controlHovered || !flat ? theme.buttonTextColor : PlasmaCore.ColorScope.textColor
|
color: controlHovered || !flat ? theme.buttonTextColor : PlasmaCore.ColorScope.textColor
|
||||||
horizontalAlignment: icon.valid ? Text.AlignLeft : Text.AlignHCenter
|
horizontalAlignment: icon.valid ? Text.AlignLeft : Text.AlignHCenter
|
||||||
verticalAlignment: Text.AlignVCenter
|
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user