From a5947f58b79e6fd5f54e13361521e1001e52064d Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Mon, 25 Mar 2024 18:14:38 +0700 Subject: [PATCH] notif clear: choreography --- .config/ags/modules/.configuration/user_options.js | 1 + .../ags/modules/sideright/centermodules/notificationlist.js | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/.config/ags/modules/.configuration/user_options.js b/.config/ags/modules/.configuration/user_options.js index c5f79983..0f8f3bb7 100644 --- a/.config/ags/modules/.configuration/user_options.js +++ b/.config/ags/modules/.configuration/user_options.js @@ -12,6 +12,7 @@ let configOptions = { 'writingCursor': " ...", // Warning: Using weird characters can mess up Markdown rendering }, 'animations': { + 'choreographyDelay': 35, 'durationSmall': 110, 'durationLarge': 180, }, diff --git a/.config/ags/modules/sideright/centermodules/notificationlist.js b/.config/ags/modules/sideright/centermodules/notificationlist.js index 73049e1e..c632cc35 100644 --- a/.config/ags/modules/sideright/centermodules/notificationlist.js +++ b/.config/ags/modules/sideright/centermodules/notificationlist.js @@ -102,7 +102,11 @@ export default (props) => { }), child: ListActionButton('clear_all', 'Clear', () => { Notifications.clear(); - notificationList.get_children().forEach(ch => ch.attribute.destroyWithAnims()) + const kids = notificationList.get_children(); + for (let i = 0; i < kids.length; i++) { + const kid = kids[i]; + Utils.timeout(userOptions.animations.choreographyDelay * i, () => kid.attribute.destroyWithAnims()); + } }) }) const notifCount = Label({