Add button to close notification
This commit is contained in:
parent
e0d1224173
commit
a82c0a5577
4 changed files with 67 additions and 15 deletions
|
|
@ -31,19 +31,12 @@ impl ObjectImpl for NotificationPopoverInner {
|
|||
}));
|
||||
});
|
||||
|
||||
let notification_widget = cascade! {
|
||||
NotificationWidget::new();
|
||||
};
|
||||
|
||||
cascade! {
|
||||
obj;
|
||||
..set_autohide(false);
|
||||
..set_has_arrow(false);
|
||||
..set_offset(0, 12);
|
||||
..set_child(Some(¬ification_widget));
|
||||
};
|
||||
|
||||
self.notification_widget.set(notification_widget);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -59,6 +52,12 @@ impl NotificationPopover {
|
|||
pub fn new(notifications: &Notifications) -> Self {
|
||||
let obj = glib::Object::new::<Self>(&[]).unwrap();
|
||||
|
||||
let notification_widget = cascade! {
|
||||
NotificationWidget::new(notifications);
|
||||
};
|
||||
obj.set_child(Some(¬ification_widget));
|
||||
obj.inner().notification_widget.set(notification_widget);
|
||||
|
||||
// XXX disconnect?
|
||||
obj.inner().notifications.set(notifications.clone());
|
||||
notifications.connect_notification_recieved(clone!(@weak obj => move |notification| {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue