diff --git a/Applications/TextEditor/main.cpp b/Applications/TextEditor/main.cpp index a35688c211..05d01cb908 100644 --- a/Applications/TextEditor/main.cpp +++ b/Applications/TextEditor/main.cpp @@ -58,6 +58,18 @@ int main(int argc, char** argv) text_editor->set_text(builder.to_string()); } + auto new_action = GAction::create("New document", { Mod_Ctrl, Key_N }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/newdocument16.rgb", { 16, 16 }), [] (const GAction&) { + dbgprintf("FIXME: Implement File/New"); + }); + + auto open_action = GAction::create("Open document", { Mod_Ctrl, Key_O }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/open16.rgb", { 16, 16 }), [] (const GAction&) { + dbgprintf("FIXME: Implement File/Open"); + }); + + auto save_action = GAction::create("Save document", { Mod_Ctrl, Key_S }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/save16.rgb", { 16, 16 }), [] (const GAction&) { + dbgprintf("FIXME: Implement File/Save"); + }); + auto menubar = make(); auto app_menu = make("TextEditor"); app_menu->add_action(GAction::create("Quit", { Mod_Alt, Key_F4 }, [] (const GAction&) { @@ -67,6 +79,9 @@ int main(int argc, char** argv) menubar->add_menu(move(app_menu)); auto file_menu = make("File"); + file_menu->add_action(new_action.copy_ref()); + file_menu->add_action(open_action.copy_ref()); + file_menu->add_action(save_action.copy_ref()); menubar->add_menu(move(file_menu)); auto edit_menu = make("Edit"); @@ -80,6 +95,10 @@ int main(int argc, char** argv) app.set_menubar(move(menubar)); + toolbar->add_action(move(new_action)); + toolbar->add_action(move(open_action)); + toolbar->add_action(move(save_action)); + auto* window = new GWindow; window->set_title(String::format("TextEditor: %s", path.characters())); window->set_rect(20, 200, 640, 400); diff --git a/Base/res/icons/newdocument16.png b/Base/res/icons/newdocument16.png new file mode 100644 index 0000000000..303561cdf7 Binary files /dev/null and b/Base/res/icons/newdocument16.png differ diff --git a/Base/res/icons/newdocument16.rgb b/Base/res/icons/newdocument16.rgb new file mode 100644 index 0000000000..b7d22d3941 Binary files /dev/null and b/Base/res/icons/newdocument16.rgb differ diff --git a/Base/res/icons/open16.png b/Base/res/icons/open16.png new file mode 100644 index 0000000000..bc4956d532 Binary files /dev/null and b/Base/res/icons/open16.png differ diff --git a/Base/res/icons/open16.rgb b/Base/res/icons/open16.rgb new file mode 100644 index 0000000000..624ba3e9c8 Binary files /dev/null and b/Base/res/icons/open16.rgb differ diff --git a/Base/res/icons/save16.png b/Base/res/icons/save16.png new file mode 100644 index 0000000000..4d223f9fc2 Binary files /dev/null and b/Base/res/icons/save16.png differ diff --git a/Base/res/icons/save16.rgb b/Base/res/icons/save16.rgb new file mode 100644 index 0000000000..18eb5422fe Binary files /dev/null and b/Base/res/icons/save16.rgb differ