diff --git a/hammond-gtk/src/appnotif.rs b/hammond-gtk/src/appnotif.rs index 1ba012e..07291a7 100644 --- a/hammond-gtk/src/appnotif.rs +++ b/hammond-gtk/src/appnotif.rs @@ -35,14 +35,18 @@ impl Default for InAppNotification { } impl InAppNotification { - pub fn new(text: String, callback: F, sender: Sender) -> Self + pub fn new(text: String, mut callback: F, sender: Sender) -> Self where F: FnMut() -> glib::Continue + 'static, { let notif = InAppNotification::default(); notif.text.set_text(&text); - let id = timeout_add_seconds(6, callback); + let revealer = notif.revealer.clone(); + let id = timeout_add_seconds(6, move || { + revealer.set_reveal_child(false); + callback() + }); let id = Rc::new(RefCell::new(Some(id))); // Cancel the callback