slidingView: Use stacked cards animation for steps

Use an animation with less motion for navigation through images with
arrow keys and buttons. For skipping multiple images and for using the
touchpad, the animations stay the same.

Closes #245
This commit is contained in:
Sophie Herold 2024-01-08 21:24:43 +01:00
parent 67339cf2da
commit 784c53b318
2 changed files with 234 additions and 43 deletions

View file

@ -1,5 +1,5 @@
// Copyright (c) 2020-2023 Christopher Davis
// Copyright (c) 2022-2023 Sophie Herold
// Copyright (c) 2022-2024 Sophie Herold
// Copyright (c) 2022 Maximiliano Sandoval R
// Copyright (c) 2023 Julian Hofer
// Copyright (c) 2023 Starccy
@ -412,7 +412,7 @@ impl LpImageView {
log::debug!("Scrolling to page for {}", new_file.uri());
self.imp().preserve_content.set(true);
sliding_view.scroll_to(&page);
sliding_view.animate_to(&page);
}
/// Ensures the sliding view contains the correct images
@ -457,7 +457,7 @@ impl LpImageView {
return;
};
self.sliding_view().scroll_to(&current_page);
self.sliding_view().animate_to(&current_page);
}
fn sliding_view(&self) -> LpSlidingView {