fix(gui): clear the selection on an empty-space click

A click between the files in the grid or list drops the selection, as
in a file manager, unless Ctrl or Shift is held. Backspace goes back
while the focus is on the files.
This commit is contained in:
nvrl committed 2026-09-23 03:48:57 +02:00
1 parent fe8fb8cdcf
commit 4fa61a14c3
3 files changed
+51

No files matched your search

+5
View File
@@ -1342,6 +1342,11 @@ fn install_shortcuts(ui: &Rc<Ui>, window: &adw::ApplicationWindow) {
gtk4::gdk::Key::Up if alt && on_browser => {
ui.browser.actions.activate_action("up", None)
}
// A focused text field takes Backspace first, so this only fires
// with the focus on the files, as in a file manager.
gtk4::gdk::Key::BackSpace if on_browser => {
ui.browser.actions.activate_action("back", None)
}
gtk4::gdk::Key::u | gtk4::gdk::Key::U if ctrl && on_browser => prompt_upload(&ui),
gtk4::gdk::Key::Menu if on_browser => popup_keyboard_context_menu(&ui),
gtk4::gdk::Key::Return | gtk4::gdk::Key::KP_Enter if alt && on_browser => {