diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-25 01:29:45 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-25 01:29:45 +0100 |
commit | 43f9027968d73e5884e19352e7d3285329773932 (patch) | |
tree | afdce34c9c1e7a125626fa32189fd1801f8231eb | |
parent | b4da451c9ae4c1c8f8c1d0dc1b32fa3aa96fbdeb (diff) | |
download | serenity-43f9027968d73e5884e19352e7d3285329773932.zip |
FileManager: Add toolbar buttons for switching the view mode.
-rw-r--r-- | Applications/FileManager/main.cpp | 10 | ||||
-rw-r--r-- | Base/res/icons/16x16/icon-view.png | bin | 0 -> 234 bytes | |||
-rw-r--r-- | Base/res/icons/16x16/table-view.png | bin | 0 -> 236 bytes |
3 files changed, 7 insertions, 3 deletions
diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp index 73ff945fad..9395ef5b22 100644 --- a/Applications/FileManager/main.cpp +++ b/Applications/FileManager/main.cpp @@ -75,11 +75,11 @@ int main(int argc, char** argv) } }); - auto view_as_list_action = GAction::create("List view", { Mod_Ctrl, KeyCode::Key_L }, [&] (const GAction&) { + auto view_as_table_action = GAction::create("Table view", { Mod_Ctrl, KeyCode::Key_L }, GraphicsBitmap::load_from_file("/res/icons/16x16/table-view.png"), [&] (const GAction&) { directory_view->set_view_mode(DirectoryView::ViewMode::List); }); - auto view_as_icons_action = GAction::create("Icon view", { Mod_Ctrl, KeyCode::Key_I }, [&] (const GAction&) { + auto view_as_icons_action = GAction::create("Icon view", { Mod_Ctrl, KeyCode::Key_I }, GraphicsBitmap::load_from_file("/res/icons/16x16/icon-view.png"), [&] (const GAction&) { directory_view->set_view_mode(DirectoryView::ViewMode::Icon); }); @@ -108,7 +108,7 @@ int main(int argc, char** argv) menubar->add_menu(move(file_menu)); auto view_menu = make<GMenu>("View"); - view_menu->add_action(view_as_list_action.copy_ref()); + view_menu->add_action(view_as_table_action.copy_ref()); view_menu->add_action(view_as_icons_action.copy_ref()); menubar->add_menu(move(view_menu)); @@ -125,6 +125,10 @@ int main(int argc, char** argv) main_toolbar->add_action(copy_action.copy_ref()); main_toolbar->add_action(delete_action.copy_ref()); + main_toolbar->add_separator(); + main_toolbar->add_action(view_as_icons_action.copy_ref()); + main_toolbar->add_action(view_as_table_action.copy_ref()); + directory_view->on_path_change = [window, location_textbox] (const String& new_path) { window->set_title(String::format("FileManager: %s", new_path.characters())); location_textbox->set_text(new_path); diff --git a/Base/res/icons/16x16/icon-view.png b/Base/res/icons/16x16/icon-view.png Binary files differnew file mode 100644 index 0000000000..b3d6cbaea2 --- /dev/null +++ b/Base/res/icons/16x16/icon-view.png diff --git a/Base/res/icons/16x16/table-view.png b/Base/res/icons/16x16/table-view.png Binary files differnew file mode 100644 index 0000000000..65ffa7bb38 --- /dev/null +++ b/Base/res/icons/16x16/table-view.png |