diff --git a/.config/quickshell/ii/modules/common/widgets/NotificationGroup.qml b/.config/quickshell/ii/modules/common/widgets/NotificationGroup.qml index 592f18a6c..a5b680ba4 100644 --- a/.config/quickshell/ii/modules/common/widgets/NotificationGroup.qml +++ b/.config/quickshell/ii/modules/common/widgets/NotificationGroup.qml @@ -10,7 +10,7 @@ import Quickshell * A group of notifications from the same app. * Similar to Android's notifications */ -Item { // Notification group area +MouseArea { // Notification group area id: root property var notificationGroup property var notifications: notificationGroup?.notifications ?? [] @@ -38,6 +38,17 @@ Item { // Notification group area destroyAnimation.running = true; } + hoverEnabled: true + onContainsMouseChanged: { + if (!root.popup) return; + if (root.containsMouse) root.notifications.forEach(notif => { + Notifications.cancelTimeout(notif.notificationId); + }); + else root.notifications.forEach(notif => { + Notifications.timeoutNotification(notif.notificationId); + }); + } + SequentialAnimation { // Drag finish animation id: destroyAnimation running: false diff --git a/.config/quickshell/ii/services/Notifications.qml b/.config/quickshell/ii/services/Notifications.qml index bf5d4e784..f1f279672 100644 --- a/.config/quickshell/ii/services/Notifications.qml +++ b/.config/quickshell/ii/services/Notifications.qml @@ -204,6 +204,12 @@ Singleton { root.discardAll(); } + function cancelTimeout(id) { + const index = root.list.findIndex((notif) => notif.notificationId === id); + if (root.list[index] != null) + root.list[index].timer.stop(); + } + function timeoutNotification(id) { const index = root.list.findIndex((notif) => notif.notificationId === id); if (root.list[index] != null)