FileManager: Added menu to show dotfiles in directory context menu

This commit is contained in:
Kesse Jones 2020-10-08 17:34:48 -03:00 committed by Andreas Kling
parent 455ce0b9c3
commit 31791945ab
Notes: sideshowbarker 2024-07-19 01:56:16 +09:00

View file

@ -470,14 +470,16 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
GUI::Application::the()->quit();
}));
auto action_show_dotfiles = GUI::Action::create_checkable("Show dotfiles", { Mod_Ctrl, Key_H }, [&](auto& action) {
directory_view.set_should_show_dotfiles(action.is_checked());
});
auto& view_menu = menubar->add_menu("View");
view_menu.add_action(*view_as_icons_action);
view_menu.add_action(*view_as_table_action);
view_menu.add_action(*view_as_columns_action);
view_menu.add_separator();
view_menu.add_action(GUI::Action::create_checkable("Show dotfiles", { Mod_Ctrl, Key_H }, [&](auto& action) {
directory_view.set_should_show_dotfiles(action.is_checked());
}));
view_menu.add_action(action_show_dotfiles);
auto& go_menu = menubar->add_menu("Go");
go_menu.add_action(go_back_action);
@ -575,6 +577,8 @@ int run_in_windowed_mode(RefPtr<Core::ConfigFile> config, String initial_locatio
directory_view_context_menu->add_action(paste_action);
directory_view_context_menu->add_action(directory_view.open_terminal_action());
directory_view_context_menu->add_separator();
directory_view_context_menu->add_action(action_show_dotfiles);
directory_view_context_menu->add_separator();
directory_view_context_menu->add_action(properties_action);
tree_view_directory_context_menu->add_action(copy_action);