[Button Styles] Fill height and vertical align
Otherwise the Text will never grow below its preferred height as the button grows smaller and will eventually leak outside at the bottom rather than stay centered. BUG: 393388 Differential Revision: https://phabricator.kde.org/D12518
This commit is contained in:
parent
f16190d89c
commit
c9e8e2e717
@ -71,14 +71,16 @@ QtQuickControlStyle.ButtonStyle {
|
||||
|
||||
PlasmaComponents.Label {
|
||||
id: label
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.fillHeight: true
|
||||
text: Util.stylizeEscapedMnemonics(Util.toHtmlEscaped(control.text))
|
||||
textFormat: Text.StyledText
|
||||
height: undefined
|
||||
font: control.font || theme.defaultFont
|
||||
visible: control.text != ""
|
||||
Layout.fillWidth: true
|
||||
color: theme.buttonTextColor
|
||||
horizontalAlignment: icon.valid ? Text.AlignLeft : Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
|
@ -94,7 +94,8 @@ QtQuickControlStyle.ButtonStyle {
|
||||
PlasmaComponents.Label {
|
||||
id: label
|
||||
Layout.minimumWidth: implicitWidth
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.fillHeight: true
|
||||
height: undefined
|
||||
text: Util.stylizeEscapedMnemonics(Util.toHtmlEscaped(control.text))
|
||||
textFormat: Text.StyledText
|
||||
font: control.font || theme.defaultFont
|
||||
@ -102,6 +103,7 @@ QtQuickControlStyle.ButtonStyle {
|
||||
Layout.fillWidth: true
|
||||
color: (controlHovered || !flat) && buttonsurfaceChecker.usedPrefix != "toolbutton-hover" ? 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