window: Add reload button and F5 shortcut
Reloading makes sense for out of memory situations or filesystems that don't support inotify.
This commit is contained in:
parent
c3547f82fc
commit
053aa5da7e
6 changed files with 56 additions and 7 deletions
|
|
@ -194,6 +194,8 @@ pub enum Action {
|
|||
ToggleProperties,
|
||||
#[strum(to_string = "win.about")]
|
||||
About,
|
||||
#[strum(to_string = "win.reload")]
|
||||
Reload,
|
||||
}
|
||||
|
||||
impl Action {
|
||||
|
|
@ -467,6 +469,17 @@ impl Action {
|
|||
win.show_about().await
|
||||
});
|
||||
}
|
||||
|
||||
Action::Reload => {
|
||||
klass.install_action_async(&action, None, move |win, _, _| async move {
|
||||
if let Some(current_page) = win.imp().image_view.current_page() {
|
||||
current_page.image().reload().await;
|
||||
} else {
|
||||
log::error!("No current image to reload");
|
||||
}
|
||||
});
|
||||
klass.add_binding_action(gdk::Key::F5, gdk::ModifierType::empty(), &action);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue