mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 02:55:49 +03:00
FileManager: Add "up to parent directory" action to toolbar.
It's not actually hooked up to anything yet, I just wanted to add something more to the toolbar. :^)
This commit is contained in:
parent
0c8242dd71
commit
e11c7a5df5
Notes:
sideshowbarker
2024-07-19 15:34:10 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/e11c7a5df52
@ -25,6 +25,10 @@ int main(int argc, char** argv)
|
||||
|
||||
GApplication app(argc, argv);
|
||||
|
||||
auto open_parent_directory_action = GAction::create("Open parent directory", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/parentdirectory16.rgb", { 16, 16 }), [] (const GAction&) {
|
||||
dbgprintf("'Parent directory' action activated!\n");
|
||||
});
|
||||
|
||||
auto mkdir_action = GAction::create("New directory...", GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/mkdir16.rgb", { 16, 16 }), [] (const GAction&) {
|
||||
dbgprintf("'New directory' action activated!\n");
|
||||
});
|
||||
@ -47,6 +51,7 @@ int main(int argc, char** argv)
|
||||
menubar->add_menu(move(app_menu));
|
||||
|
||||
auto file_menu = make<GMenu>("File");
|
||||
file_menu->add_action(open_parent_directory_action.copy_ref());
|
||||
file_menu->add_action(mkdir_action.copy_ref());
|
||||
file_menu->add_action(copy_action.copy_ref());
|
||||
file_menu->add_action(delete_action.copy_ref());
|
||||
@ -70,6 +75,7 @@ int main(int argc, char** argv)
|
||||
widget->set_layout(make<GBoxLayout>(Orientation::Vertical));
|
||||
|
||||
auto* toolbar = new GToolBar(widget);
|
||||
toolbar->add_action(open_parent_directory_action.copy_ref());
|
||||
toolbar->add_action(mkdir_action.copy_ref());
|
||||
toolbar->add_action(copy_action.copy_ref());
|
||||
toolbar->add_action(delete_action.copy_ref());
|
||||
|
BIN
Base/res/icons/parentdirectory16.png
Normal file
BIN
Base/res/icons/parentdirectory16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 289 B |
BIN
Base/res/icons/parentdirectory16.rgb
Normal file
BIN
Base/res/icons/parentdirectory16.rgb
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user