feat(gui): menu-model context menus with keyboard and background menu

Context menus are PopoverMenus built from gio::Menu through a small
ActionMenu helper, so they are keyboard navigable and read as menus. My
Files follows the item order of UI_UX_PLAN.md §6, adds Open With…, Copy
Link and Versions…, and gains a background menu on empty space and the
Menu key / Shift+F10. The photo tile menu and the ⋮ row menus on Shared
by Me and Computers use the same helper.
This commit is contained in:
nvrl committed 2026-09-23 03:04:32 +02:00
1 parent 91a5f21340
commit 8d0a575a7c
8 files changed
+361 -273

No files matched your search

+7
View File
@@ -18,6 +18,7 @@ use pages::takeout::*;
use pages::trash::*;
use pages::verify::*;
use widgets::details::*;
use widgets::menu::*;
use widgets::share_dialog::*;
use widgets::thumbnails::*;
use widgets::versions_dialog::*;
@@ -1310,6 +1311,12 @@ fn install_shortcuts(ui: &Rc<Ui>, window: &adw::ApplicationWindow) {
ui.browser.actions.activate_action("up", 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::F10
if on_browser && state.contains(gtk4::gdk::ModifierType::SHIFT_MASK) =>
{
popup_keyboard_context_menu(&ui)
}
gtk4::gdk::Key::F2 if on_browser => {
// Renaming is one name at a time; saying so beats a key that
// silently does nothing with several items highlighted.