diff options
author | Tommy Nguyen <remyabel@gmail.com> | 2019-12-12 17:15:17 -0500 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-12-12 23:53:12 +0100 |
commit | 091c78362621fd987075eca219424dd119bd8a98 (patch) | |
tree | 73359425cd4c2735fd1c0aefa3a827e0528cc0ec /Applications/FileManager | |
parent | 9150be47161ac233f286117f113040afc1af37a2 (diff) | |
download | serenity-091c78362621fd987075eca219424dd119bd8a98.zip |
FileManager: Check which widget has focus for context menu actions
This fixes the issue where application shortcuts only operated on the
TreeView.
Diffstat (limited to 'Applications/FileManager')
-rw-r--r-- | Applications/FileManager/main.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp index 53e20ab85b..100ee3e929 100644 --- a/Applications/FileManager/main.cpp +++ b/Applications/FileManager/main.cpp @@ -192,7 +192,7 @@ int main(int argc, char** argv) auto copy_action = GCommonActions::make_copy_action([&](const GAction& action) { Vector<String> paths; - if (action.activator() == directory_context_menu) { + if (action.activator() == directory_context_menu || directory_view->active_widget()->is_focused()) { paths = selected_file_paths(); } else { paths = tree_view_selected_file_paths(); @@ -245,7 +245,7 @@ int main(int argc, char** argv) auto& model = directory_view->model(); String path; Vector<String> selected; - if (action.activator() == directory_context_menu) { + if (action.activator() == directory_context_menu || directory_view->active_widget()->is_focused()) { path = directory_view->path(); selected = selected_file_paths(); } else { @@ -267,7 +267,7 @@ int main(int argc, char** argv) auto do_delete = [&](ConfirmBeforeDelete confirm, const GAction& action) { Vector<String> paths; - if (action.activator() == directory_context_menu) { + if (action.activator() == directory_context_menu || directory_view->active_widget()->is_focused()) { paths = selected_file_paths(); } else { paths = tree_view_selected_file_paths(); |