window: Add Home/End shortcuts for first/last img

This is the same as in EOG.
Also add PageUp/Down for image navigation from EOG.
Cleanup the navigation enums as well.
This commit is contained in:
Sophie Herold 2023-02-06 19:14:01 +01:00
parent 169dd454cc
commit 69889820cd
6 changed files with 65 additions and 13 deletions

View file

@ -207,6 +207,16 @@ impl LpFileModel {
.collect()
}
/// Return first path
pub fn first(&self) -> Option<PathBuf> {
self.imp().files.borrow().first().cloned()
}
/// Returns last path
pub fn last(&self) -> Option<PathBuf> {
self.imp().files.borrow().last().cloned()
}
/// Currently sorts by name
fn sort(files: &mut IndexSet<PathBuf>) {
files.sort_by(|x, y| util::compare_by_name(x, y));