[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
This commit is contained in:
Nate Graham 2021-06-17 13:49:25 -06:00
parent 56915dc113
commit bbf9c54dd8

View file

@ -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