From bbf9c54dd8b91454505920132f031dc81b982d72 Mon Sep 17 00:00:00 2001 From: Nate Graham Date: Thu, 17 Jun 2021 13:49:25 -0600 Subject: [PATCH] [kcmkwin/kwineffects] Collapse list item when clicking on it again Currently, each effect's list items expands when you click on any non-interactive part of it, but it does not collapse when you click on it again. With this commit, now it does. BUG: 421883 FIXED-IN: 5.23 --- src/kcmkwin/kwineffects/package/contents/ui/Effect.qml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/kcmkwin/kwineffects/package/contents/ui/Effect.qml b/src/kcmkwin/kwineffects/package/contents/ui/Effect.qml index 9c8082148e..0ea0281088 100644 --- a/src/kcmkwin/kwineffects/package/contents/ui/Effect.qml +++ b/src/kcmkwin/kwineffects/package/contents/ui/Effect.qml @@ -17,7 +17,13 @@ Kirigami.SwipeListItem { id: listItem hoverEnabled: true onClicked: { - view.currentIndex = index; + if (view.currentIndex == index) { + // Collapse list item + view.currentIndex = -1; + } else { + // Expand list item + view.currentIndex = index; + } } contentItem: RowLayout { id: row