diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-20 19:21:47 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-09-20 19:21:47 +1000 |
| commit | 688cc213ef0e30a9655847320f7602139d5903bb (patch) | |
| tree | 4e6a59a1462e8378e72233b6c40f204c35149612 /modules/sidebar | |
| parent | sidebar/notifs: better preview anim (diff) | |
| download | caelestia-shell-688cc213ef0e30a9655847320f7602139d5903bb.tar.gz caelestia-shell-688cc213ef0e30a9655847320f7602139d5903bb.tar.bz2 caelestia-shell-688cc213ef0e30a9655847320f7602139d5903bb.zip | |
sidebar/notifs: better expand/close anim
Diffstat (limited to 'modules/sidebar')
| -rw-r--r-- | modules/sidebar/NotifGroupList.qml | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/modules/sidebar/NotifGroupList.qml b/modules/sidebar/NotifGroupList.qml index 93aca8c..c9aac27 100644 --- a/modules/sidebar/NotifGroupList.qml +++ b/modules/sidebar/NotifGroupList.qml @@ -26,18 +26,35 @@ Item { } readonly property int spacing: Math.round(Appearance.spacing.small / 2) + property bool showAllNotifs property bool flag signal requestToggleExpand(expand: bool) + onExpandedChanged: { + if (expanded) { + clearTimer.stop(); + showAllNotifs = true; + } else { + clearTimer.start(); + } + } + Layout.fillWidth: true implicitHeight: nonAnimHeight + Timer { + id: clearTimer + + interval: Appearance.anim.durations.normal + onTriggered: root.showAllNotifs = false + } + Repeater { id: repeater model: ScriptModel { - values: root.expanded ? root.notifs : root.notifs.slice(0, Config.notifs.groupPreviewNum + 1) + values: root.showAllNotifs ? root.notifs : root.notifs.slice(0, Config.notifs.groupPreviewNum + 1) onValuesChanged: root.flagChanged() } @@ -120,7 +137,7 @@ Item { Component.onDestruction: modelData.unlock(this) ParallelAnimation { - running: !notif.previewHidden + Component.onCompleted: running = !notif.previewHidden Anim { target: notif |