From d184e5327a57db8245fcb449daa15f016c9d9e06 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Mon, 30 Aug 2021 20:11:44 +0200 Subject: [PATCH] FileManager: Put file launch actions first The default action (shown in bold) indicates what would you get by double-clicking on file. Since it's a default option, I think it deserves to be on top (together with alternative launch options). :^) Also they're not task actions like "Extract .zip here" or "Add to bookmarks". --- Userland/Applications/FileManager/main.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/Userland/Applications/FileManager/main.cpp b/Userland/Applications/FileManager/main.cpp index cd84bd754b..f37e3403da 100644 --- a/Userland/Applications/FileManager/main.cpp +++ b/Userland/Applications/FileManager/main.cpp @@ -392,6 +392,11 @@ int run_in_desktop_mode() desktop_context_menu->popup(event.screen_position()); } else { file_context_menu = GUI::Menu::construct("Directory View File"); + + bool added_open_menu_items = add_launch_handler_actions_to_menu(file_context_menu, directory_view, node.full_path(), file_context_menu_action_default_action, current_file_handlers); + if (added_open_menu_items) + file_context_menu->add_separator(); + file_context_menu->add_action(cut_action); file_context_menu->add_action(copy_action); file_context_menu->add_action(paste_action); @@ -404,10 +409,6 @@ int run_in_desktop_mode() file_context_menu->add_separator(); } - bool added_open_menu_items = add_launch_handler_actions_to_menu(file_context_menu, directory_view, node.full_path(), file_context_menu_action_default_action, current_file_handlers); - if (added_open_menu_items) - file_context_menu->add_separator(); - file_context_menu->add_action(properties_action); file_context_menu->popup(event.screen_position(), file_context_menu_action_default_action); } @@ -1055,6 +1056,11 @@ int run_in_windowed_mode(String initial_location, String entry_focused_on_init) directory_context_menu->popup(event.screen_position()); } else { file_context_menu = GUI::Menu::construct("Directory View File"); + + bool added_launch_file_handlers = add_launch_handler_actions_to_menu(file_context_menu, directory_view, node.full_path(), file_context_menu_action_default_action, current_file_handlers); + if (added_launch_file_handlers) + file_context_menu->add_separator(); + file_context_menu->add_action(cut_action); file_context_menu->add_action(copy_action); file_context_menu->add_action(paste_action); @@ -1068,10 +1074,6 @@ int run_in_windowed_mode(String initial_location, String entry_focused_on_init) file_context_menu->add_separator(); } - bool added_launch_file_handlers = add_launch_handler_actions_to_menu(file_context_menu, directory_view, node.full_path(), file_context_menu_action_default_action, current_file_handlers); - if (added_launch_file_handlers) - file_context_menu->add_separator(); - file_context_menu->add_action(properties_action); file_context_menu->popup(event.screen_position(), file_context_menu_action_default_action); }