feat: close notification on right click (#386)
Co-authored-by: Jas Singh <jaskiratpal.singh@outlook.com>
This commit is contained in:
@@ -55,21 +55,26 @@ 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({
|
||||||
class_name: 'notification-card',
|
on_secondary_click: () => {
|
||||||
vpack: 'start',
|
notifs.CloseNotification(notif.id);
|
||||||
hexpand: true,
|
},
|
||||||
children: [
|
child: Widget.Box({
|
||||||
Image(notif),
|
class_name: 'notification-card',
|
||||||
Widget.Box({
|
vpack: 'start',
|
||||||
vpack: 'start',
|
hexpand: true,
|
||||||
vertical: true,
|
children: [
|
||||||
hexpand: true,
|
Image(notif),
|
||||||
class_name: `notification-card-content ${!notifHasImg(notif) ? 'noimg' : ''}`,
|
Widget.Box({
|
||||||
children: [Header(notif), Body(notif), Action(notif, notifs)],
|
vpack: 'start',
|
||||||
}),
|
vertical: true,
|
||||||
CloseButton(notif, notifs),
|
hexpand: true,
|
||||||
],
|
class_name: `notification-card-content ${!notifHasImg(notif) ? 'noimg' : ''}`,
|
||||||
|
children: [Header(notif), Body(notif), Action(notif, notifs)],
|
||||||
|
}),
|
||||||
|
CloseButton(notif, notifs),
|
||||||
|
],
|
||||||
|
}),
|
||||||
});
|
});
|
||||||
}));
|
}));
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user