Close notification on click
This commit is contained in:
parent
cc8da887e6
commit
efcb3c5aec
1 changed files with 12 additions and 1 deletions
|
|
@ -1,5 +1,9 @@
|
|||
use cascade::cascade;
|
||||
use gtk4::{glib, prelude::*, subclass::prelude::*};
|
||||
use gtk4::{
|
||||
glib::{self, clone},
|
||||
prelude::*,
|
||||
subclass::prelude::*,
|
||||
};
|
||||
|
||||
use crate::deref_cell::DerefCell;
|
||||
|
||||
|
|
@ -17,6 +21,13 @@ impl ObjectSubclass for NotificationPopoverInner {
|
|||
|
||||
impl ObjectImpl for NotificationPopoverInner {
|
||||
fn constructed(&self, obj: &NotificationPopover) {
|
||||
obj.add_controller(&cascade! {
|
||||
gtk4::GestureClick::new();
|
||||
..connect_pressed(clone!(@weak obj => move |_, _, _, _| {
|
||||
obj.popdown();
|
||||
}));
|
||||
});
|
||||
|
||||
let label = cascade! {
|
||||
gtk4::Label::new(None);
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue