FileManager: Add a toolbar button for going to the home directory.

Fixes #308.
This commit is contained in:
Andreas Kling 2019-07-21 09:19:09 +02:00
parent aa2224a2f0
commit 5f0f1ce9d2
Notes: sideshowbarker 2024-07-19 13:07:06 +09:00
2 changed files with 5 additions and 0 deletions

View File

@ -144,6 +144,10 @@ int main(int argc, char** argv)
directory_view->open_next_directory();
});
auto go_home_action = GAction::create("Go to Home Directory", GraphicsBitmap::load_from_file("/res/icons/16x16/go-home.png"), [directory_view](auto&) {
directory_view->open(get_current_user_home_path());
});
auto menubar = make<GMenuBar>();
auto app_menu = make<GMenu>("File Manager");
@ -181,6 +185,7 @@ int main(int argc, char** argv)
main_toolbar->add_action(go_back_action);
main_toolbar->add_action(go_forward_action);
main_toolbar->add_action(open_parent_directory_action);
main_toolbar->add_action(go_home_action);
main_toolbar->add_separator();
main_toolbar->add_action(mkdir_action);

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 B