image_page: Use AdwSpinner

Depends on
https://gitlab.gnome.org/GNOME/libadwaita/-/merge_requests/1201/

AdwSpinner automatically handles pausing the animation
when unmapped.

Part-of: <https://gitlab.gnome.org/GNOME/loupe/-/merge_requests/420>
This commit is contained in:
Christopher Davis 2024-07-06 13:52:59 -04:00 • committed by Sophie Herold
parent 4a1a4d270c
commit cd68778890
2 changed files with 2 additions and 12 deletions

View file

@ -51,7 +51,7 @@ mod imp {
#[template_child]
pub(super) image_stack_page: TemplateChild<gtk::Widget>,
#[template_child]
pub(super) spinner: TemplateChild<gtk::Spinner>,
pub(super) spinner: TemplateChild<gtk::Widget>,
#[template_child]
pub(super) scrolled_window: TemplateChild<gtk::ScrolledWindow>,
#[template_child]
@ -145,10 +145,6 @@ mod imp {
glib::spawn_future_local(async move { obj.show_error().await });
}
));
// Do not waste CPU on spinner if it is not visible
self.spinner.connect_map(|s| s.start());
self.spinner.connect_unmap(|s| s.stop());
}
}