diff --git a/desktoppackage/contents/configuration/ConfigCategoryDelegate.qml b/desktoppackage/contents/configuration/ConfigCategoryDelegate.qml --- a/desktoppackage/contents/configuration/ConfigCategoryDelegate.qml +++ b/desktoppackage/contents/configuration/ConfigCategoryDelegate.qml @@ -128,14 +128,19 @@ state: current && categoriesScroll.activeFocus ? QIconItem.SelectedState : QIconItem.DefaultState } + // FIXME: This label is center-aligned with a maximum width instead + // of the more conventional combination of "Layout.fillWidth: true" + // and "horizontalAlignment: Text.AlignHCenter" because that combination + // triggers https://bugreports.qt.io/browse/QTBUG-49646 + // centering doesn't work when lineCount > 1 so we turn Text.AlignHCenter on + QtControls.Label { id: nameLabel - Layout.fillWidth: true - Layout.leftMargin: units.smallSpacing - Layout.rightMargin: units.smallSpacing + Layout.alignment: Qt.AlignHCenter + Layout.maximumWidth: delegateContents.width - units.smallSpacing * 2 text: model.name wrapMode: Text.Wrap - horizontalAlignment: Text.AlignHCenter + horizontalAlignment: lineCount > 1 ? Text.AlignHCenter : undefined color: current && categoriesScroll.activeFocus ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor Behavior on color { ColorAnimation {