application: Shortcuts for non-animated next/prev
Don't animate switching between images for Alt+Arrow. Closes #45
This commit is contained in:
parent
fc1a44776a
commit
6958f427bd
4 changed files with 45 additions and 13 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue