[TabButton] Align center icon and text when text is beside the icon

This commit is contained in:
Mikel Johnson 2020-11-14 16:40:20 +00:00 committed by Carl Schwan
parent 90e92a9c67
commit 9df6f42c60

View File

@ -32,7 +32,7 @@ T.TabButton {
PlasmaCore.IconItem {
id: icon
Layout.alignment: Qt.AlignCenter
Layout.alignment: control.display != T.AbstractButton.TextBesideIcon ? Qt.AlignCenter : Qt.AlignVCenter | Qt.AlignRight
Layout.fillWidth: true
Layout.fillHeight: true
@ -52,7 +52,7 @@ T.TabButton {
}
Label {
id: label
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
text: control.Kirigami.MnemonicData.richTextLabel
font: control.font