diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-21 09:19:09 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-21 09:19:09 +0200 |
commit | 5f0f1ce9d296ae53e564a3cb04f61f9e2442f739 (patch) | |
tree | 18cfc402d0e88a8c77d12ff592273c3a224bb666 | |
parent | aa2224a2f05961b571ced26b504dd5eac84db994 (diff) | |
download | serenity-5f0f1ce9d296ae53e564a3cb04f61f9e2442f739.zip |
FileManager: Add a toolbar button for going to the home directory.
Fixes #308.
-rw-r--r-- | Applications/FileManager/main.cpp | 5 | ||||
-rw-r--r-- | Base/res/icons/16x16/go-home.png | bin | 0 -> 183 bytes |
2 files changed, 5 insertions, 0 deletions
diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp index 905f58ad7c..e18c3067e5 100644 --- a/Applications/FileManager/main.cpp +++ b/Applications/FileManager/main.cpp @@ -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); diff --git a/Base/res/icons/16x16/go-home.png b/Base/res/icons/16x16/go-home.png Binary files differnew file mode 100644 index 0000000000..4ee56b5109 --- /dev/null +++ b/Base/res/icons/16x16/go-home.png |