From 7d81445341e85f913188d6bd293357e2520e631a Mon Sep 17 00:00:00 2001 From: Ethan Todd <30243637+ewtodd@users.noreply.github.com> Date: Thu, 18 Dec 2025 08:28:58 -0500 Subject: [PATCH] notifications: add modal function for clearing all (#1082) --- quickshell/Modals/NotificationModal.qml | 9 +++++++++ quickshell/Services/NotificationService.qml | 3 +++ 2 files changed, 12 insertions(+) diff --git a/quickshell/Modals/NotificationModal.qml b/quickshell/Modals/NotificationModal.qml index 128d8d5c..500c641b 100644 --- a/quickshell/Modals/NotificationModal.qml +++ b/quickshell/Modals/NotificationModal.qml @@ -57,6 +57,10 @@ DankModal { } } + function clearAll() { + NotificationService.clearAllNotifications(); + } + modalWidth: 500 modalHeight: 700 backgroundColor: Theme.withAlpha(Theme.surfaceContainer, Theme.popupTransparency) @@ -104,6 +108,11 @@ DankModal { return "NOTIFICATION_MODAL_TOGGLE_DND_SUCCESS"; } + function clearAll(): string { + notificationModal.clearAll(); + return "NOTIFICATION_MODAL_CLEAR_ALL_SUCCESS"; + } + target: "notifications" } diff --git a/quickshell/Services/NotificationService.qml b/quickshell/Services/NotificationService.qml index b6e82b2c..87b6d946 100644 --- a/quickshell/Services/NotificationService.qml +++ b/quickshell/Services/NotificationService.qml @@ -414,6 +414,9 @@ Singleton { } function clearAllNotifications() { + if (!notifications.length) { + return; + } bulkDismissing = true; popupsDisabled = true; addGate.stop();