application: Shortcuts for non-animated next/prev

Don't animate switching between images for Alt+Arrow.

Closes #45
This commit is contained in:
Sophie Herold 2024-01-31 23:34:25 +01:00
parent fc1a44776a
commit 6958f427bd
4 changed files with 45 additions and 13 deletions

View file

@ -554,6 +554,16 @@ impl LpSlidingView {
.cloned()
}
/// Move to specified page without animation
pub fn instant_to(&self, page: &LpImagePage) {
if let Some(index) = self.index_of(page) {
self.set_current_page(Some(page));
self.set_position(index as f64 - self.position_shift());
} else {
log::error!("Page not in LpSlidingView {}", page.file().uri());
}
}
/// Move to specified page with animation
pub fn animate_to(&self, page: &LpImagePage) {
if let Some(index) = self.index_of(page) {