From 5c2fb3677479d25c3476267a690481e4bceef491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Danielle=20For=C3=A9?= Date: Fri, 4 Sep 2026 10:35:35 -0700 Subject: [PATCH] Indicator: create remove action --- src/Indicator.vala | 9 +++++++++ src/Widgets/NotificationEntry.vala | 2 ++ 2 files changed, 11 insertions(+) diff --git a/src/Indicator.vala b/src/Indicator.vala index ed1b1128..d725e9b2 100644 --- a/src/Indicator.vala +++ b/src/Indicator.vala @@ -17,6 +17,8 @@ public class Notifications.Indicator : Wingpanel.Indicator { private NotificationsList nlist; private NotificationsMonitor monitor; + private SimpleActionGroup action_group; + public Indicator () { Object ( code_name: Wingpanel.Indicator.MESSAGES, @@ -37,6 +39,12 @@ public class Notifications.Indicator : Wingpanel.Indicator { notify_settings = new GLib.Settings ("io.elementary.notifications"); app_settings_cache = new Gee.HashMap (); + var remove_notification_action = new SimpleAction ("remove-notification", VariantType.STRING); + // remove_notification_action.activate.connect (action_remove_notification); + + action_group = new SimpleActionGroup (); + action_group.add_action (remove_notification_action); + monitor = new NotificationsMonitor (); } @@ -48,6 +56,7 @@ public class Notifications.Indicator : Wingpanel.Indicator { }; nlist = new NotificationsList (); + nlist.insert_action_group (Wingpanel.Indicator.MESSAGES, action_group); nlist.items_changed.connect (set_display_icon_name); monitor.notification_received.connect (on_notification_received); diff --git a/src/Widgets/NotificationEntry.vala b/src/Widgets/NotificationEntry.vala index adcdd541..75a812e8 100644 --- a/src/Widgets/NotificationEntry.vala +++ b/src/Widgets/NotificationEntry.vala @@ -296,10 +296,12 @@ public class Notifications.NotificationEntry : Gtk.ListBoxRow { private void dismiss () { if (!revealer.child_revealed) { + activate_action (Wingpanel.Indicator.MESSAGES + ".remove-notification"); remove (notification); } else { revealer.notify["child-revealed"].connect (() => { if (!revealer.child_revealed) { + activate_action (Wingpanel.Indicator.MESSAGES + ".remove-notification"); remove (notification); } });