Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/Indicator.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -37,6 +39,12 @@ public class Notifications.Indicator : Wingpanel.Indicator {
notify_settings = new GLib.Settings ("io.elementary.notifications");
app_settings_cache = new Gee.HashMap<string, Settings> ();

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 ();
}

Expand All @@ -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);
Expand Down
2 changes: 2 additions & 0 deletions src/Widgets/NotificationEntry.vala
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
Expand Down
Loading