diff --git a/podcasts-gtk/src/app.rs b/podcasts-gtk/src/app.rs index 04bb9d5..d27ca80 100644 --- a/podcasts-gtk/src/app.rs +++ b/podcasts-gtk/src/app.rs @@ -312,7 +312,7 @@ impl App { glib::Continue(false) }; let undo_cb: Option = None; - let notif = InAppNotification::new(&err, 6, callback, undo_cb); + let notif = InAppNotification::new(&err, 6000, callback, undo_cb); notif.show(&self.overlay); } Action::ShowUpdateNotif(receiver) => { @@ -328,7 +328,7 @@ impl App { }; let txt = i18n("Fetching new episodes"); let undo_cb: Option = None; - let updater = InAppNotification::new(&txt, 1, callback, undo_cb); + let updater = InAppNotification::new(&txt, 250, callback, undo_cb); updater.set_close_state(State::Hidden); updater.set_spinner_state(SpinnerState::Active); diff --git a/podcasts-gtk/src/widgets/appnotif.rs b/podcasts-gtk/src/widgets/appnotif.rs index 5814e6c..9bb29fa 100644 --- a/podcasts-gtk/src/widgets/appnotif.rs +++ b/podcasts-gtk/src/widgets/appnotif.rs @@ -48,6 +48,7 @@ impl Default for InAppNotification { } } +/// Timer should be in milliseconds impl InAppNotification { pub(crate) fn new( text: &str, @@ -64,9 +65,9 @@ impl InAppNotification { let revealer_weak = notif.revealer.downgrade(); let mut time = 0; - let id = timeout_add_seconds(1, move || { + let id = timeout_add(250, move || { if time < timer { - time += 1; + time += 250; return glib::Continue(true); }; diff --git a/podcasts-gtk/src/widgets/show_menu.rs b/podcasts-gtk/src/widgets/show_menu.rs index 95ef3a3..b97b1be 100644 --- a/podcasts-gtk/src/widgets/show_menu.rs +++ b/podcasts-gtk/src/widgets/show_menu.rs @@ -148,7 +148,7 @@ pub(crate) fn mark_all_notif(pd: Arc, sender: &Sender) -> InAppNot let undo_callback = clone!(sender => move || sender.send(Action::RefreshWidgetIfSame(id))); let text = i18n("Marked all episodes as listened"); - InAppNotification::new(&text, 6, callback, Some(undo_callback)) + InAppNotification::new(&text, 6000, callback, Some(undo_callback)) } pub(crate) fn remove_show_notif(pd: Arc, sender: Sender) -> InAppNotification { @@ -184,5 +184,5 @@ pub(crate) fn remove_show_notif(pd: Arc, sender: Sender) -> InAppN sender.send(Action::RefreshEpisodesView); }; - InAppNotification::new(&text, 6, callback, Some(undo_callback)) + InAppNotification::new(&text, 6000, callback, Some(undo_callback)) }