From 0b3c1b4c79046125e3d38d752378ed0f221aa5b2 Mon Sep 17 00:00:00 2001 From: Paulo Henrique Silva Date: Tue, 8 Mar 2022 14:20:20 -0300 Subject: Mandelbrot: Add Help menu with standard About action Noticed that Mandelbrot didn't use the standard About action in the Help menu. As a first patch to Serenity, this patch fixes it. --- Userland/Demos/Mandelbrot/Mandelbrot.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Userland') diff --git a/Userland/Demos/Mandelbrot/Mandelbrot.cpp b/Userland/Demos/Mandelbrot/Mandelbrot.cpp index 1d06224447..4284a89467 100644 --- a/Userland/Demos/Mandelbrot/Mandelbrot.cpp +++ b/Userland/Demos/Mandelbrot/Mandelbrot.cpp @@ -421,16 +421,18 @@ ErrorOr serenity_main(Main::Arguments arguments) }, window); + auto app_icon = GUI::Icon::default_icon("app-mandelbrot"); + window->set_icon(app_icon.bitmap_for_size(16)); + auto view_menu = TRY(window->try_add_menu("&View")); TRY(view_menu->try_add_action(zoom_in_action)); TRY(view_menu->try_add_action(reset_zoom_action)); TRY(view_menu->try_add_action(zoom_out_action)); - window->show(); + auto help_menu = TRY(window->try_add_menu("&Help")); + TRY(help_menu->try_add_action(GUI::CommonActions::make_about_action("Mandelbrot Demo", app_icon, window))); - auto app_icon = GUI::Icon::default_icon("app-mandelbrot"); - window->set_icon(app_icon.bitmap_for_size(16)); + window->show(); window->set_cursor(Gfx::StandardCursor::Zoom); - return app->exec(); } -- cgit v1.2.3