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
+16
View File
@@ -101,6 +101,22 @@ export function NotificationWidget(notification: AstalNotifd.Notification|number
]
} as Widget.BoxProps)
]
} as Widget.BoxProps),
new Widget.Box({
className: "actions button-row",
hexpand: true,
visible: notification.actions.length > 0,
children: notification.actions.map((action: AstalNotifd.Action) =>
new Widget.Button({
className: "action",
label: action.label,
hexpand: true,
onClicked: () => {
notification.invoke(action.id);
onClose && onClose(notification);
}
} as Widget.ButtonProps)
)
} as Widget.BoxProps)
]
} as Widget.BoxProps)