From 973957127dd4e00cb52de68c6634719a989a22fc Mon Sep 17 00:00:00 2001 From: Ismael Asensio Date: Fri, 15 May 2020 18:29:23 +0200 Subject: [PATCH] [kcm/kwinrules] Fix placeholder message in RulesEditor Summary: Fix the anchoring of the placeholder message after https://phabricator.kde.org/R108:9e5498238f88ece28f4f0d22da00879280cb7955 It needs to center on the free space, not the whole ListView. Test Plan Before: {F8323417} After: {F8323416} Reviewers: ngraham, broulik, #vdg, #plasma Reviewed By: ngraham, #vdg Subscribers: kwin Tags: #kwin Differential Revision: https://phabricator.kde.org/D29783 --- kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml b/kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml index b71c8e5f58..7ca478bd76 100644 --- a/kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml +++ b/kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml @@ -48,7 +48,15 @@ ScrollViewKCM { Kirigami.PlaceholderMessage { id: hintArea visible: rulesView.count <= 4 - anchors.centerIn: parent + anchors { + // We need to center on the free space below contentItem, not the full ListView. + // Setting both top and bottom anchors (or using anchors.fill) stretches the component + // and distorts the spacing between its internal items. + // This is fine as long as we have a single item here. + horizontalCenter: parent.horizontalCenter + top: parent.contentItem.bottom + bottom: parent.bottom + } width: parent.width - (units.largeSpacing * 4) helpfulAction: QQC2.Action { text: i18n("Add Properties...")