From cd68778890a9004660bca5f298035c376a1063fa Mon Sep 17 00:00:00 2001 From: Christopher Davis Date: Sat, 6 Jul 2024 13:52:59 -0400 Subject: [PATCH] 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: --- src/widgets/image_page.rs | 6 +----- src/widgets/image_page.ui | 8 +------- 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/src/widgets/image_page.rs b/src/widgets/image_page.rs index 87378c0..c81edaf 100644 --- a/src/widgets/image_page.rs +++ b/src/widgets/image_page.rs @@ -51,7 +51,7 @@ mod imp { #[template_child] pub(super) image_stack_page: TemplateChild, #[template_child] - pub(super) spinner: TemplateChild, + pub(super) spinner: TemplateChild, #[template_child] pub(super) scrolled_window: TemplateChild, #[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()); } } diff --git a/src/widgets/image_page.ui b/src/widgets/image_page.ui index ec8abad..5a3f1e8 100644 --- a/src/widgets/image_page.ui +++ b/src/widgets/image_page.ui @@ -47,13 +47,7 @@ true true - - 24 - 24 - center - center - True - +