diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-07 21:43:43 +0100 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-07 21:43:43 +0100 |
commit | 054e4caf49d95b9ec6e2d43a0d1acf052bdec58d (patch) | |
tree | ec0c5a5537a85f1f96679da53a6873ed9c47d459 | |
parent | 27b0aab13e00d621716b46f9360c77b5ad69cc59 (diff) | |
download | serenity-054e4caf49d95b9ec6e2d43a0d1acf052bdec58d.zip |
TextEditor: Add Cut/Copy/Paste placeholder actions.
-rw-r--r-- | Applications/TextEditor/main.cpp | 21 | ||||
-rw-r--r-- | Base/res/icons/cut16.png | bin | 0 -> 359 bytes | |||
-rw-r--r-- | Base/res/icons/cut16.rgb | bin | 0 -> 1024 bytes | |||
-rw-r--r-- | Base/res/icons/paste16.png | bin | 0 -> 391 bytes | |||
-rw-r--r-- | Base/res/icons/paste16.rgb | bin | 0 -> 1024 bytes |
5 files changed, 21 insertions, 0 deletions
diff --git a/Applications/TextEditor/main.cpp b/Applications/TextEditor/main.cpp index c1939ba7f8..aa97bff280 100644 --- a/Applications/TextEditor/main.cpp +++ b/Applications/TextEditor/main.cpp @@ -72,6 +72,18 @@ int main(int argc, char** argv) text_editor->write_to_file(path); }); + auto cut_action = GAction::create("Cut", { Mod_Ctrl, Key_X }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/cut16.rgb", { 16, 16 }), [&] (const GAction&) { + dbgprintf("FIXME: Implement Edit/Cut"); + }); + + auto copy_action = GAction::create("Copy", { Mod_Ctrl, Key_C }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/copyfile16.rgb", { 16, 16 }), [&] (const GAction&) { + dbgprintf("FIXME: Implement Edit/Copy"); + }); + + auto paste_action = GAction::create("Paste", { Mod_Ctrl, Key_V }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/paste16.rgb", { 16, 16 }), [&] (const GAction&) { + dbgprintf("FIXME: Implement Edit/Paste"); + }); + auto menubar = make<GMenuBar>(); auto app_menu = make<GMenu>("TextEditor"); app_menu->add_action(GAction::create("Quit", { Mod_Alt, Key_F4 }, [] (const GAction&) { @@ -87,6 +99,9 @@ int main(int argc, char** argv) menubar->add_menu(move(file_menu)); auto edit_menu = make<GMenu>("Edit"); + edit_menu->add_action(cut_action.copy_ref()); + edit_menu->add_action(copy_action.copy_ref()); + edit_menu->add_action(paste_action.copy_ref()); menubar->add_menu(move(edit_menu)); auto help_menu = make<GMenu>("Help"); @@ -101,6 +116,12 @@ int main(int argc, char** argv) toolbar->add_action(move(open_action)); toolbar->add_action(move(save_action)); + toolbar->add_separator(); + + toolbar->add_action(move(cut_action)); + toolbar->add_action(move(copy_action)); + toolbar->add_action(move(paste_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/cut16.png b/Base/res/icons/cut16.png Binary files differnew file mode 100644 index 0000000000..d623d0c18e --- /dev/null +++ b/Base/res/icons/cut16.png diff --git a/Base/res/icons/cut16.rgb b/Base/res/icons/cut16.rgb Binary files differnew file mode 100644 index 0000000000..c124b63555 --- /dev/null +++ b/Base/res/icons/cut16.rgb diff --git a/Base/res/icons/paste16.png b/Base/res/icons/paste16.png Binary files differnew file mode 100644 index 0000000000..f5d793b065 --- /dev/null +++ b/Base/res/icons/paste16.png diff --git a/Base/res/icons/paste16.rgb b/Base/res/icons/paste16.rgb Binary files differnew file mode 100644 index 0000000000..f66bc3821a --- /dev/null +++ b/Base/res/icons/paste16.rgb |