mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 14:07:42 +00:00
FileManager: Add a toolbar button for going to the home directory.
Fixes #308.
This commit is contained in:
parent
aa2224a2f0
commit
5f0f1ce9d2
2 changed files with 5 additions and 0 deletions
|
@ -144,6 +144,10 @@ int main(int argc, char** argv)
|
||||||
directory_view->open_next_directory();
|
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 menubar = make<GMenuBar>();
|
||||||
|
|
||||||
auto app_menu = make<GMenu>("File Manager");
|
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_back_action);
|
||||||
main_toolbar->add_action(go_forward_action);
|
main_toolbar->add_action(go_forward_action);
|
||||||
main_toolbar->add_action(open_parent_directory_action);
|
main_toolbar->add_action(open_parent_directory_action);
|
||||||
|
main_toolbar->add_action(go_home_action);
|
||||||
|
|
||||||
main_toolbar->add_separator();
|
main_toolbar->add_separator();
|
||||||
main_toolbar->add_action(mkdir_action);
|
main_toolbar->add_action(mkdir_action);
|
||||||
|
|
BIN
Base/res/icons/16x16/go-home.png
Normal file
BIN
Base/res/icons/16x16/go-home.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 183 B |
Loading…
Add table
Add a link
Reference in a new issue