center text when no icon

This commit is contained in:
Marco Martin 2018-10-17 17:54:41 +02:00
parent 828ab59eb1
commit 584f7709e1

View File

@ -40,13 +40,15 @@ T.Button {
contentItem: RowLayout {
PlasmaCore.IconItem {
id: icon
Layout.fillWidth: true
Layout.fillHeight: true
colorGroup: PlasmaCore.ColorScope.colorGroup
colorGroup: PlasmaCore.Theme.ButtonColorGroup
visible: source.length > 0
source: control.icon ? (control.icon.name || control.icon.source) : ""
}
Label {
Layout.fillWidth: !icon.visible
visible: text.length > 0
text: control.text
font: control.font