feat: close notification on right click (#386)
Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
@@ -55,7 +55,11 @@ export default (): Window<Box<Child, Attribute>, unknown> => {
|
|||||||
const filteredNotifications = filterNotifications(notifications, ignoredNotifs);
|
const filteredNotifications = filterNotifications(notifications, ignoredNotifs);
|
||||||
|
|
||||||
return (self.children = filteredNotifications.slice(0, displayedTotal.value).map((notif) => {
|
return (self.children = filteredNotifications.slice(0, displayedTotal.value).map((notif) => {
|
||||||
return Widget.Box({
|
return Widget.EventBox({
|
||||||
|
on_secondary_click: () => {
|
||||||
|
notifs.CloseNotification(notif.id);
|
||||||
|
},
|
||||||
|
child: Widget.Box({
|
||||||
class_name: 'notification-card',
|
class_name: 'notification-card',
|
||||||
vpack: 'start',
|
vpack: 'start',
|
||||||
hexpand: true,
|
hexpand: true,
|
||||||
@@ -70,6 +74,7 @@ export default (): Window<Box<Child, Attribute>, unknown> => {
|
|||||||
}),
|
}),
|
||||||
CloseButton(notif, notifs),
|
CloseButton(notif, notifs),
|
||||||
],
|
],
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user