From 9ce8e84f5e6990d82866556d4cc47e9262c82343 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Thu, 8 Apr 2021 17:51:43 -0600 Subject: [PATCH] Fix PC3 TabButton alignment Prior to a45bd758001310d39b9c36ee1617cc12d622c62a, 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. --- src/declarativeimports/plasmacomponents3/TabButton.qml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/declarativeimports/plasmacomponents3/TabButton.qml b/src/declarativeimports/plasmacomponents3/TabButton.qml index 98affe974..c368a85bb 100644 --- a/src/declarativeimports/plasmacomponents3/TabButton.qml +++ b/src/declarativeimports/plasmacomponents3/TabButton.qml @@ -61,13 +61,12 @@ 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 color: control.visualFocus ? PlasmaCore.ColorScope.highlightColor : PlasmaCore.ColorScope.textColor 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 elide: Text.ElideRight }