From e11c7a5df5278347a001309e4abfb400e19ba512 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 2 Mar 2019 02:20:11 +0100 Subject: [PATCH] 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. :^) --- Applications/FileManager/main.cpp | 6 ++++++ Base/res/icons/parentdirectory16.png | Bin 0 -> 289 bytes Base/res/icons/parentdirectory16.rgb | Bin 0 -> 1024 bytes 3 files changed, 6 insertions(+) create mode 100644 Base/res/icons/parentdirectory16.png create mode 100644 Base/res/icons/parentdirectory16.rgb diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp index 602af8fa7e..92c9899d00 100644 --- a/Applications/FileManager/main.cpp +++ b/Applications/FileManager/main.cpp @@ -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("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(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()); diff --git a/Base/res/icons/parentdirectory16.png b/Base/res/icons/parentdirectory16.png new file mode 100644 index 0000000000000000000000000000000000000000..93ab5b6152e994a0ddc7fa02e94c8eb32af3714f GIT binary patch literal 289 zcmeAS@N?(olHy`uVBq!ia0y~yU=RRd4mJh`2Kmqb6B!s7*pj^6T^Rm@;DWu&Co?cG za29w(7BevDDT6R$#Zvn+1_lQ95>H=O_Q%XjjKZev#`6Lh7#Ji=Tq8=H^K)}k^GX<; zi&7IyQd1PlGfOfQ+&z5*!W;R-85kHkJzX3_EKVmUNL+DHTl39c(bVUMiFVct0h1QN z`On1H-#0QaFfgd8|2^m7$yI4?i+CKa^Dyt=NmOw&wsVfSAbNLyA?vwkBGXcS{QG9f zd@_-tnD-1r%)jH(+(($YcoP)W9TlrP7ckB_G)cnHaSJ!cQHF&E2~R|(9XY_m!_%|s k@*j=jgKyXP7ML-tp5Zt#@mOsJ0|Nttr>mdKI;Vst0H@_()Bpeg literal 0 HcmV?d00001 diff --git a/Base/res/icons/parentdirectory16.rgb b/Base/res/icons/parentdirectory16.rgb new file mode 100644 index 0000000000000000000000000000000000000000..bca26259a8fee7680f8d4dca8a7ca52b6c38d872 GIT binary patch literal 1024 zcmZP=#Gp1z=0Ca41L<8^XZs&SlWGP?4@mE{Ox6D&4B``O21qTkUXXqe28k0g1EdC< zUXXqe2Fc?y10;`(VS13o@aadE1L=Y3M;0fRJ(%=^+=7gW@dHRb$p7dVBu=b;kXme* bNc{}cGF35fZI}#$-!xT%Mu61e!pNEdFt(8g literal 0 HcmV?d00001