diff --git a/desktoppackage/contents/explorer/AppletDelegate.qml b/desktoppackage/contents/explorer/AppletDelegate.qml --- a/desktoppackage/contents/explorer/AppletDelegate.qml +++ b/desktoppackage/contents/explorer/AppletDelegate.qml @@ -207,27 +207,36 @@ } } } + + // FIXME: These labels are 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 then we turn Text.AlignHCenter on again + PlasmaExtras.Heading { id: heading - Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter + Layout.maximumWidth: mainLayout.width level: 4 text: model.name elide: Text.ElideRight wrapMode: Text.WordWrap maximumLineCount: 2 lineHeight: 0.95 - horizontalAlignment: Text.AlignHCenter + horizontalAlignment: lineCount > 1 ? Text.AlignHCenter : undefined } PlasmaComponents.Label { - Layout.fillWidth: true + Layout.alignment: Qt.AlignHCenter + Layout.maximumWidth: mainLayout.width // otherwise causes binding loop due to the way the Plasma sets the height height: implicitHeight text: model.description font.pointSize: theme.smallestFont.pointSize wrapMode: Text.WordWrap elide: Text.ElideRight maximumLineCount: heading.lineCount === 1 ? 3 : 2 - horizontalAlignment: Text.AlignHCenter + horizontalAlignment: lineCount > 1 ? Text.AlignHCenter : undefined } } }