summaryrefslogtreecommitdiff
path: root/Applications/TextEditor/main.cpp
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-03-20 18:16:04 +0100
committerAndreas Kling <awesomekling@gmail.com>2019-03-20 18:16:04 +0100
commitf0915641c58295b8f117d04845d31724aae86ea6 (patch)
tree84bb6794d936a143b0cf78c27ccea3d7349fb852 /Applications/TextEditor/main.cpp
parentdaa1dcb5e8612da1aae8eaa146153a25e90dc60f (diff)
downloadserenity-f0915641c58295b8f117d04845d31724aae86ea6.zip
TextEditor: Add "delete" action.
Diffstat (limited to 'Applications/TextEditor/main.cpp')
-rw-r--r--Applications/TextEditor/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Applications/TextEditor/main.cpp b/Applications/TextEditor/main.cpp
index 16023de124..71ae2ad5d1 100644
--- a/Applications/TextEditor/main.cpp
+++ b/Applications/TextEditor/main.cpp
@@ -77,6 +77,10 @@ int main(int argc, char** argv)
text_editor->paste();
});
+ auto delete_action = GAction::create("Delete", { 0, Key_Delete }, GraphicsBitmap::load_from_file(GraphicsBitmap::Format::RGBA32, "/res/icons/16x16/delete.rgb", { 16, 16 }), [&] (const GAction&) {
+ text_editor->delete_selection();
+ });
+
auto menubar = make<GMenuBar>();
auto app_menu = make<GMenu>("TextEditor");
app_menu->add_action(GAction::create("Quit", { Mod_Alt, Key_F4 }, [] (const GAction&) {
@@ -98,6 +102,7 @@ int main(int argc, char** argv)
edit_menu->add_action(cut_action.copy_ref());
edit_menu->add_action(copy_action.copy_ref());
edit_menu->add_action(paste_action.copy_ref());
+ edit_menu->add_action(delete_action.copy_ref());
menubar->add_menu(move(edit_menu));
auto font_menu = make<GMenu>("Font");
@@ -126,6 +131,7 @@ int main(int argc, char** argv)
toolbar->add_action(move(cut_action));
toolbar->add_action(move(copy_action));
toolbar->add_action(move(paste_action));
+ toolbar->add_action(move(delete_action));
toolbar->add_separator();