diff options
Diffstat (limited to 'Applications/FileManager/main.cpp')
-rw-r--r-- | Applications/FileManager/main.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp index 257c77955c..f2d52c0a5a 100644 --- a/Applications/FileManager/main.cpp +++ b/Applications/FileManager/main.cpp @@ -178,6 +178,8 @@ int main(int argc, char** argv) } }); + auto properties_action = GAction::create("Properties...", { Mod_Alt, Key_Return }, [](auto&) {}); + auto delete_action = GAction::create("Delete", GraphicsBitmap::load_from_file("/res/icons/16x16/delete.png"), [](const GAction&) { dbgprintf("'Delete' action activated!\n"); }); @@ -271,6 +273,17 @@ int main(int argc, char** argv) progressbar->set_visible(true); }; + auto context_menu = make<GMenu>(); + context_menu->add_action(copy_action); + context_menu->add_action(paste_action); + context_menu->add_action(delete_action); + context_menu->add_separator(); + context_menu->add_action(properties_action); + + directory_view->on_context_menu_request = [&](const GAbstractView&, const GModelIndex&, const GContextMenuEvent& event) { + context_menu->popup(event.screen_position()); + }; + // our initial location is defined as, in order of precedence: // 1. the first command-line argument (e.g. FileManager /bin) // 2. the user's home directory |