From d13c39bec6f26448c003f23f1123cfcc3919bada Mon Sep 17 00:00:00 2001 From: Ismael Asensio Date: Fri, 7 Jan 2022 11:04:42 +0000 Subject: [PATCH] kcm/kwinrules: Fix header in properties list This provides a better fix for the header positioning bug in the properties list sheet, instead of the previous workaround (which wasn't enough in some situations) Upstream bugfix (in the Kirigami component) is not advisable as it could cause unintended consequencies in other uses/apps See also: https://bugs.kde.org/show_bug.cgi?id=422289 BUG: 421583 FIXED-IN: 5.24 --- .../package/contents/ui/RulesEditor.qml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/src/kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml b/src/kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml index 49ab2e15e5..83a99b02a2 100644 --- a/src/kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml +++ b/src/kcmkwin/kwinrules/package/contents/ui/RulesEditor.qml @@ -173,7 +173,10 @@ ScrollViewKCM { section { property: "section" - delegate: Kirigami.ListSectionHeader { label: section } + delegate: Kirigami.ListSectionHeader { + label: section + height: implicitHeight + } } delegate: Kirigami.AbstractListItem { @@ -240,7 +243,6 @@ ScrollViewKCM { onSheetOpenChanged: { searchField.text = ""; if (sheetOpen) { - overlayModel.ready = true; searchField.forceActiveFocus(); } else { overlayModel.onlySuggestions = false; @@ -290,19 +292,8 @@ ScrollViewKCM { invalidateFilter(); } - // Delay the model filtering until `ready` is set - // FIXME: Workaround https://bugs.kde.org/show_bug.cgi?id=422289 - property bool ready: false - onReadyChanged: { - invalidateFilter(); - } - filterString: searchField.text.trim().toLowerCase() filterRowCallback: (source_row, source_parent) => { - if (!ready) { - return false; - } - var index = sourceModel.index(source_row, 0, source_parent); var hasSuggestion = sourceModel.data(index, RulesModel.SuggestedValueRole) != null;