From c7a943b1c779872309380d1d968fd252c17544b5 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Thu, 9 Apr 2026 16:14:36 +1000 Subject: [PATCH] fix: close notif group notifs in batches --- modules/sidebar/NotifActionList.qml | 2 +- modules/sidebar/NotifDockList.qml | 29 +++++++++++++++++++---------- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/modules/sidebar/NotifActionList.qml b/modules/sidebar/NotifActionList.qml index dfc83bd2..84e6103c 100644 --- a/modules/sidebar/NotifActionList.qml +++ b/modules/sidebar/NotifActionList.qml @@ -150,7 +150,7 @@ Item { id: actionInner anchors.centerIn: parent - sourceComponent: action.modelData.isClose || action.modelData.isCopy ? iconBtn : root.notif.hasActionIcons ? iconComp : textComp + sourceComponent: action.modelData.isClose || action.modelData.isCopy ? iconBtn : root.notif?.hasActionIcons ? iconComp : textComp } Component { diff --git a/modules/sidebar/NotifDockList.qml b/modules/sidebar/NotifDockList.qml index a799cf1a..11dde291 100644 --- a/modules/sidebar/NotifDockList.qml +++ b/modules/sidebar/NotifDockList.qml @@ -62,16 +62,7 @@ LazyListView { property int startY function closeAll(): void { - for (const n of Notifs.notClosed.filter(n => n.appName === modelData)) - n.close(); - } - - containmentMask: QtObject { - function contains(p: point): bool { - if (!root.container.contains(notif.mapToItem(root.container, p))) - return false; - return notifInner.contains(p); - } + clearTimer.start(); } LazyListView.preferredHeight: closed ? 0 : notifInner.nonAnimHeight @@ -111,6 +102,24 @@ LazyListView { closeAll(); } + Timer { + id: clearTimer + + interval: 15 + repeat: true + triggeredOnStart: true + onTriggered: { + const notifs = Notifs.notClosed.filter(n => n.appName === notif.modelData); + if (notifs.length === 0) { + stop(); + return; + } + + for (const n of notifs.slice(0, 30)) + n.close(); + } + } + NotifGroup { id: notifInner