diff --git a/news.d/47.rc/fixed-avoid-flickering-when-reloading-image b/news.d/47.0/fixed-avoid-flickering-when-reloading-image similarity index 100% rename from news.d/47.rc/fixed-avoid-flickering-when-reloading-image rename to news.d/47.0/fixed-avoid-flickering-when-reloading-image diff --git a/news.d/47.0/fixed-wrong-image-shown-with-animations-disabled b/news.d/47.0/fixed-wrong-image-shown-with-animations-disabled new file mode 100644 index 0000000..a50107b --- /dev/null +++ b/news.d/47.0/fixed-wrong-image-shown-with-animations-disabled @@ -0,0 +1 @@ +When disabling animations in the OS and using the buttons to change the image, the wrong image was shown, disabling features like zoom. diff --git a/src/widgets/sliding_view.rs b/src/widgets/sliding_view.rs index 583de20..c83e829 100644 --- a/src/widgets/sliding_view.rs +++ b/src/widgets/sliding_view.rs @@ -356,6 +356,9 @@ mod imp { let position_shift = self.position_shift.get() as f32; let page_position = page_index as f32; + // Reset from potential stacked cards animation + page.set_opacity(1.); + // reverse page order for RTL languages let direction_sign = if self.is_rtl() { -1. } else { 1. }; @@ -617,6 +620,8 @@ impl LpSlidingView { *self.imp().position_tracking.borrow_mut() = PositionTracking::StackedCards(StackedCards::new(prev_page, backward)); + // Set current page here as well, to make sure it's set when animation completes for disabled animations + self.set_current_page(Some(page)); animation.play(); } } @@ -631,8 +636,8 @@ impl LpSlidingView { animation.set_value_from(self.position()); animation.set_value_to(index as f64 - self.position_shift()); animation.set_initial_velocity(initial_velocity); - animation.play(); self.set_current_page(Some(page)); + animation.play(); } else { log::error!("Page not in LpSlidingView {}", page.file().uri()); }