Fix PC3 TabButton alignment
Prior to a45bd75800
, label alignment was
controlled by its Layout properties. However that commit made the label
fill width to fix elision, which means that the Layout.Alignment property
no longer has any effect anymore. Therefore, we need to use the
horizontalAlignment property to position the text within its
now-width-filling box.
This commit is contained in:
parent
46b46c8135
commit
9ce8e84f5e
@ -61,13 +61,12 @@ T.TabButton {
|
|||||||
Label {
|
Label {
|
||||||
id: label
|
id: label
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.alignment: control.display != T.AbstractButton.TextBesideIcon || icon.source.length === 0 ? Qt.AlignCenter : Qt.AlignVCenter | Qt.AlignLeft
|
|
||||||
visible: text.length > 0 && control.display !== T.AbstractButton.IconOnly
|
visible: text.length > 0 && control.display !== T.AbstractButton.IconOnly
|
||||||
text: control.Kirigami.MnemonicData.richTextLabel
|
text: control.Kirigami.MnemonicData.richTextLabel
|
||||||
font: control.font
|
font: control.font
|
||||||
color: control.visualFocus ? PlasmaCore.ColorScope.highlightColor : PlasmaCore.ColorScope.textColor
|
color: control.visualFocus ? PlasmaCore.ColorScope.highlightColor : PlasmaCore.ColorScope.textColor
|
||||||
opacity: enabled || control.highlighted || control.checked ? 1 : 0.4
|
opacity: enabled || control.highlighted || control.checked ? 1 : 0.4
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: control.display != T.AbstractButton.TextBesideIcon || icon.source.length === 0 ? Text.AlignHCenter : Text.AlignLeft
|
||||||
verticalAlignment: Text.AlignVCenter
|
verticalAlignment: Text.AlignVCenter
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user