feat(ags/notifications): add support to actions in floating notifications(popups)

This commit is contained in:
retrozinndev
2025-03-11 16:16:07 -03:00
parent 55a2a9c545
commit 12e4cf58b6
12 changed files with 162 additions and 109 deletions
+5 -3
View File
@@ -125,11 +125,13 @@ class Notifications extends GObject.Object {
}
public removeNotification(notif: (AstalNotifd.Notification|number)): void {
const notifId = (notif instanceof AstalNotifd.Notification) ? notif.id : notif;
const notification = (notif instanceof AstalNotifd.Notification) ? notif : AstalNotifd.get_default().get_notification(notif);
this.#notifications = this.#notifications.filter((item: AstalNotifd.Notification) =>
item.id !== notifId);
item.id !== notification.id);
notification.dismiss();
this.notify("notifications");
this.emit("notification-removed", notifId);
this.emit("notification-removed", notification.id);
}
connect(signal: string, callback: (...args: any[]) => void): number {