From db299e9804d7895a4756bd4a4448caf7de5b4c21 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Mon, 14 Feb 2022 13:28:09 +0100 Subject: [PATCH] Playground: Add editor actions to the window menu --- Userland/DevTools/Playground/main.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Userland/DevTools/Playground/main.cpp b/Userland/DevTools/Playground/main.cpp index a32328f66f..d71fb5c876 100644 --- a/Userland/DevTools/Playground/main.cpp +++ b/Userland/DevTools/Playground/main.cpp @@ -214,6 +214,17 @@ ErrorOr serenity_main(Main::Arguments arguments) }))); auto edit_menu = TRY(window->try_add_menu("&Edit")); + TRY(edit_menu->try_add_action(editor->undo_action())); + TRY(edit_menu->try_add_action(editor->redo_action())); + TRY(edit_menu->try_add_separator()); + TRY(edit_menu->try_add_action(editor->cut_action())); + TRY(edit_menu->try_add_action(editor->copy_action())); + TRY(edit_menu->try_add_action(editor->paste_action())); + TRY(edit_menu->try_add_separator()); + TRY(edit_menu->try_add_action(editor->select_all_action())); + TRY(edit_menu->try_add_action(editor->go_to_line_action())); + TRY(edit_menu->try_add_separator()); + TRY(edit_menu->try_add_action(GUI::Action::create("&Format GML", { Mod_Ctrl | Mod_Shift, Key_I }, [&](auto&) { auto formatted_gml_or_error = GUI::GML::format_gml(editor->text()); if (!formatted_gml_or_error.is_error()) {