diff --git a/Applications/Calculator/main.cpp b/Applications/Calculator/main.cpp index e9a8aab6693..7ff18b94bf1 100644 --- a/Applications/Calculator/main.cpp +++ b/Applications/Calculator/main.cpp @@ -25,7 +25,6 @@ */ #include "CalculatorWidget.h" -#include #include #include #include @@ -77,9 +76,7 @@ int main(int argc, char** argv) })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](const GUI::Action&) { - GUI::AboutDialog::show("Calculator", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Calculator", app_icon)); app->set_menubar(move(menubar)); diff --git a/Applications/Calendar/main.cpp b/Applications/Calendar/main.cpp index 95dec9d3016..aebc5c4fed4 100644 --- a/Applications/Calendar/main.cpp +++ b/Applications/Calendar/main.cpp @@ -25,7 +25,6 @@ */ #include "AddEventDialog.h" -#include #include #include #include @@ -175,9 +174,7 @@ int main(int argc, char** argv) })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Calendar", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Calendar", app_icon)); app->set_menubar(move(menubar)); window->show(); diff --git a/Applications/DisplaySettings/main.cpp b/Applications/DisplaySettings/main.cpp index 4c5fc487b92..50188934702 100644 --- a/Applications/DisplaySettings/main.cpp +++ b/Applications/DisplaySettings/main.cpp @@ -25,7 +25,6 @@ */ #include "DisplaySettings.h" -#include #include #include #include @@ -75,9 +74,7 @@ int main(int argc, char** argv) })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](const GUI::Action&) { - GUI::AboutDialog::show("Display Settings", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Display Settings", app_icon)); app->set_menubar(move(menubar)); window->show(); diff --git a/Applications/FileManager/main.cpp b/Applications/FileManager/main.cpp index dd69343974e..df690a30d56 100644 --- a/Applications/FileManager/main.cpp +++ b/Applications/FileManager/main.cpp @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -649,9 +648,7 @@ int run_in_windowed_mode(RefPtr config, String initial_locatio })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("File Manager", Gfx::Bitmap::load_from_file("/res/icons/32x32/filetype-folder.png"), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("File Manager", GUI::Icon::default_icon("filetype-folder"))); GUI::Application::the()->set_menubar(move(menubar)); diff --git a/Applications/FontEditor/main.cpp b/Applications/FontEditor/main.cpp index 756a0dba06f..f0a72d1d29b 100644 --- a/Applications/FontEditor/main.cpp +++ b/Applications/FontEditor/main.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -145,9 +144,8 @@ int main(int argc, char** argv) help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) { Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/FontEditor.md"), "/bin/Help"); })); - help_menu.add_action(GUI::Action::create("About", [&](const GUI::Action&) { - GUI::AboutDialog::show("Font Editor", app_icon.bitmap_for_size(32), window); - })); + + help_menu.add_action(GUI::CommonActions::make_about_action("Font Editor", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Applications/Help/main.cpp b/Applications/Help/main.cpp index 01b7ed52234..31a74791f24 100644 --- a/Applications/Help/main.cpp +++ b/Applications/Help/main.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -275,9 +274,7 @@ int main(int argc, char* argv[]) auto menubar = GUI::MenuBar::construct(); auto& app_menu = menubar->add_menu("Help"); - app_menu.add_action(GUI::Action::create("About", [&](const GUI::Action&) { - GUI::AboutDialog::show("Help", app_icon.bitmap_for_size(32), window); - })); + app_menu.add_action(GUI::CommonActions::make_about_action("Help", app_icon, window)); app_menu.add_separator(); app_menu.add_action(GUI::CommonActions::make_quit_action([](auto&) { GUI::Application::the()->quit(); diff --git a/Applications/HexEditor/HexEditorWidget.cpp b/Applications/HexEditor/HexEditorWidget.cpp index abcd2077652..e6f6711884e 100644 --- a/Applications/HexEditor/HexEditorWidget.cpp +++ b/Applications/HexEditor/HexEditorWidget.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -191,9 +190,7 @@ HexEditorWidget::HexEditorWidget() } auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Hex Editor", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-hexeditor.png"), window()); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Hex Editor", GUI::Icon::default_icon("Hex Editor"), window())); GUI::Application::the()->set_menubar(move(menubar)); diff --git a/Applications/IRCClient/IRCAppWindow.cpp b/Applications/IRCClient/IRCAppWindow.cpp index a3e628b7858..cfe6f101bf7 100644 --- a/Applications/IRCClient/IRCAppWindow.cpp +++ b/Applications/IRCClient/IRCAppWindow.cpp @@ -28,7 +28,6 @@ #include "IRCChannel.h" #include "IRCWindow.h" #include "IRCWindowListModel.h" -#include #include #include #include @@ -296,9 +295,7 @@ void IRCAppWindow::setup_menus() channel_menu.add_action(*m_part_action); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [this](auto&) { - GUI::AboutDialog::show("IRC Client", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-irc-client.png"), this); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("IRC Client", GUI::Icon::default_icon("app-irc-client"), this)); GUI::Application::the()->set_menubar(move(menubar)); } diff --git a/Applications/KeyboardMapper/main.cpp b/Applications/KeyboardMapper/main.cpp index 891926e3c25..0edeef72fe9 100644 --- a/Applications/KeyboardMapper/main.cpp +++ b/Applications/KeyboardMapper/main.cpp @@ -26,7 +26,6 @@ #include "KeyboardMapperWidget.h" #include -#include #include #include #include @@ -56,7 +55,7 @@ int main(int argc, char** argv) auto app_icon = GUI::Icon::default_icon("app-keyboard-mapper"); auto window = GUI::Window::construct(); - window->set_title("KeyboardMapper"); + window->set_title("Keyboard Mapper"); window->set_icon(app_icon.bitmap_for_size(16)); window->set_main_widget(); window->resize(775, 315); @@ -98,15 +97,10 @@ int main(int argc, char** argv) app->quit(); }); - auto about_action = GUI::Action::create("About", - [&](auto&) { - GUI::AboutDialog::show("KeyboardMapper", app_icon.bitmap_for_size(32), window); - }); - // Menu auto menubar = GUI::MenuBar::construct(); - auto& app_menu = menubar->add_menu("KeyboardMapper"); + auto& app_menu = menubar->add_menu("Keyboard Mapper"); app_menu.add_action(open_action); app_menu.add_action(save_action); app_menu.add_action(save_as_action); @@ -114,7 +108,7 @@ int main(int argc, char** argv) app_menu.add_action(quit_action); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(about_action); + help_menu.add_action(GUI::CommonActions::make_about_action("Keyboard Mapper", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Applications/KeyboardSettings/main.cpp b/Applications/KeyboardSettings/main.cpp index d45b631398d..8b515d815ec 100644 --- a/Applications/KeyboardSettings/main.cpp +++ b/Applications/KeyboardSettings/main.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -114,7 +113,7 @@ int main(int argc, char** argv) ASSERT(initial_keymap_index < character_map_files.size()); auto window = GUI::Window::construct(); - window->set_title("Keyboard settings"); + window->set_title("Keyboard Settings"); window->resize(300, 70); window->set_icon(app_icon.bitmap_for_size(16)); @@ -187,18 +186,13 @@ int main(int argc, char** argv) app->quit(); }); - auto about_action = GUI::Action::create("About", - [&](auto&) { - GUI::AboutDialog::show("Keyboard settings", app_icon.bitmap_for_size(32), window); - }); - auto menubar = GUI::MenuBar::construct(); - auto& app_menu = menubar->add_menu("Keyboard settings"); + auto& app_menu = menubar->add_menu("Keyboard Settings"); app_menu.add_action(quit_action); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(about_action); + help_menu.add_action(GUI::CommonActions::make_about_action("Keyboard Settings", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Applications/MouseSettings/main.cpp b/Applications/MouseSettings/main.cpp index ec6e6452ad6..74b07d0b0a7 100644 --- a/Applications/MouseSettings/main.cpp +++ b/Applications/MouseSettings/main.cpp @@ -24,7 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include @@ -57,7 +56,7 @@ int main(int argc, char** argv) auto app_icon = GUI::Icon::default_icon("app-mouse"); auto window = GUI::Window::construct(); - window->set_title("Mouse settings"); + window->set_title("Mouse Settings"); window->resize(200, 130); window->set_resizable(false); window->set_icon(app_icon.bitmap_for_size(16)); @@ -121,14 +120,12 @@ int main(int argc, char** argv) }; auto menubar = GUI::MenuBar::construct(); - auto& app_menu = menubar->add_menu("Mouse settings"); + auto& app_menu = menubar->add_menu("Mouse Settings"); app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Mouse settings", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Mouse Settings", app_icon, window)); app->set_menubar(move(menubar)); window->show(); diff --git a/Applications/Piano/main.cpp b/Applications/Piano/main.cpp index 04bf0d4cd52..dc75e2944d4 100644 --- a/Applications/Piano/main.cpp +++ b/Applications/Piano/main.cpp @@ -32,7 +32,6 @@ #include #include #include -#include #include #include #include @@ -130,9 +129,7 @@ int main(int argc, char** argv) main_widget.add_actions(edit_menu); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](const GUI::Action&) { - GUI::AboutDialog::show("Piano", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Piano", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Applications/PixelPaint/main.cpp b/Applications/PixelPaint/main.cpp index 47a401c925e..02164a52ce5 100644 --- a/Applications/PixelPaint/main.cpp +++ b/Applications/PixelPaint/main.cpp @@ -36,7 +36,6 @@ #include "Tool.h" #include "ToolPropertiesWidget.h" #include "ToolboxWidget.h" -#include #include #include #include @@ -350,9 +349,7 @@ int main(int argc, char** argv) })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("PixelPaint", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("PixelPaint", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Applications/QuickShow/main.cpp b/Applications/QuickShow/main.cpp index 3227610ebc1..2319c24a9a9 100644 --- a/Applications/QuickShow/main.cpp +++ b/Applications/QuickShow/main.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -247,11 +246,6 @@ int main(int argc, char** argv) toolbar_container.set_visible(!toolbar_container.is_visible()); }); - auto about_action = GUI::Action::create("About", - [&](auto&) { - GUI::AboutDialog::show("QuickShow", app_icon.bitmap_for_size(32), window); - }); - auto copy_action = GUI::CommonActions::make_copy_action([&](auto&) { if (widget.bitmap()) GUI::Clipboard::the().set_bitmap(*widget.bitmap()); @@ -301,7 +295,7 @@ int main(int argc, char** argv) view_menu.add_action(hide_show_toolbar_action); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(about_action); + help_menu.add_action(GUI::CommonActions::make_about_action("QuickShow", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Applications/SoundPlayer/main.cpp b/Applications/SoundPlayer/main.cpp index cb0ae4a6072..47dbd555c89 100644 --- a/Applications/SoundPlayer/main.cpp +++ b/Applications/SoundPlayer/main.cpp @@ -26,7 +26,6 @@ #include "SoundPlayerWidget.h" #include -#include #include #include #include @@ -61,13 +60,13 @@ int main(int argc, char** argv) auto app_icon = GUI::Icon::default_icon("app-sound-player"); auto window = GUI::Window::construct(); - window->set_title("SoundPlayer"); + window->set_title("Sound Player"); window->set_resizable(false); window->resize(350, 140); window->set_icon(app_icon.bitmap_for_size(16)); auto menubar = GUI::MenuBar::construct(); - auto& app_menu = menubar->add_menu("SoundPlayer"); + auto& app_menu = menubar->add_menu("Sound Player"); auto& player = window->set_main_widget(window, audio_client); if (argc > 1) { @@ -101,9 +100,7 @@ int main(int argc, char** argv) playback_menu.add_action(move(loop)); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("SoundPlayer", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Sound Player", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Applications/Spreadsheet/main.cpp b/Applications/Spreadsheet/main.cpp index df806add79a..5b7663e44f4 100644 --- a/Applications/Spreadsheet/main.cpp +++ b/Applications/Spreadsheet/main.cpp @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -244,9 +243,7 @@ int main(int argc, char* argv[]) app_menu.add_separator(); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Spreadsheet", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Spreadsheet", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Applications/SystemMonitor/main.cpp b/Applications/SystemMonitor/main.cpp index c757cc9ef50..ef2fdcea71c 100644 --- a/Applications/SystemMonitor/main.cpp +++ b/Applications/SystemMonitor/main.cpp @@ -36,7 +36,6 @@ #include "ThreadStackWidget.h" #include #include -#include #include #include #include @@ -305,9 +304,7 @@ int main(int argc, char** argv) make_frequency_action("5 sec", 5000); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](const GUI::Action&) { - GUI::AboutDialog::show("System Monitor", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("System Monitor", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Applications/Terminal/main.cpp b/Applications/Terminal/main.cpp index 09764d99ac3..68518e60797 100644 --- a/Applications/Terminal/main.cpp +++ b/Applications/Terminal/main.cpp @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -476,9 +475,7 @@ int main(int argc, char** argv) help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) { Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/Terminal.md"), "/bin/Help"); })); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Terminal", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Terminal", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Applications/TextEditor/TextEditorWidget.cpp b/Applications/TextEditor/TextEditorWidget.cpp index 64a1eedd445..03997d2b2e0 100644 --- a/Applications/TextEditor/TextEditorWidget.cpp +++ b/Applications/TextEditor/TextEditorWidget.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -476,9 +475,7 @@ TextEditorWidget::TextEditorWidget() syntax_menu.add_action(*m_shell_highlight); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Text Editor", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-text-editor.png"), window()); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Text Editor", GUI::Icon::default_icon("app-text-editor"), window())); GUI::Application::the()->set_menubar(move(menubar)); diff --git a/Demos/CatDog/main.cpp b/Demos/CatDog/main.cpp index e7a20acef2c..c6408a7d2f8 100644 --- a/Demos/CatDog/main.cpp +++ b/Demos/CatDog/main.cpp @@ -26,7 +26,6 @@ */ #include -#include #include #include #include @@ -224,9 +223,7 @@ int main(int argc, char** argv) auto& app_menu = menubar->add_menu("CatDog Demo"); app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("CatDog Demo", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("CatDog Demo", app_icon, window)); app->set_menubar(move(menubar)); window->show(); diff --git a/Demos/Eyes/main.cpp b/Demos/Eyes/main.cpp index c7218465d3b..0b2fe4ad86c 100644 --- a/Demos/Eyes/main.cpp +++ b/Demos/Eyes/main.cpp @@ -26,7 +26,6 @@ #include "EyesWidget.h" #include -#include #include #include #include @@ -104,9 +103,7 @@ int main(int argc, char* argv[]) app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Eyes Demo", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Eyes Demo", app_icon, window)); app->set_menubar(move(menubar)); window->show(); diff --git a/Demos/Mouse/main.cpp b/Demos/Mouse/main.cpp index 31379eb0493..80960610a86 100644 --- a/Demos/Mouse/main.cpp +++ b/Demos/Mouse/main.cpp @@ -24,7 +24,6 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include #include #include #include @@ -203,9 +202,7 @@ int main(int argc, char** argv) app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Mouse Demo", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Mouse Demo", app_icon, window)); app->set_menubar(move(menubar)); window->set_resizable(false); diff --git a/Demos/WidgetGallery/main.cpp b/Demos/WidgetGallery/main.cpp index fb08d54e292..37e5c4efa25 100644 --- a/Demos/WidgetGallery/main.cpp +++ b/Demos/WidgetGallery/main.cpp @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -115,9 +114,7 @@ int main(int argc, char** argv) app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Widget Gallery", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Widget Gallery", app_icon, window)); auto& root_widget = window->set_main_widget(); root_widget.set_fill_with_background_color(true); diff --git a/DevTools/HackStudio/HackStudioWidget.cpp b/DevTools/HackStudio/HackStudioWidget.cpp index 2e1b67f09b8..0ce256e2649 100644 --- a/DevTools/HackStudio/HackStudioWidget.cpp +++ b/DevTools/HackStudio/HackStudioWidget.cpp @@ -51,7 +51,6 @@ #include #include #include -#include #include #include #include @@ -890,9 +889,7 @@ void HackStudioWidget::create_view_menubar(GUI::MenuBar& menubar) void HackStudioWidget::create_help_menubar(GUI::MenuBar& menubar) { auto& help_menu = menubar.add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [this](auto&) { - GUI::AboutDialog::show("HackStudio", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-hack-studio.png"), window()); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Hack Studio", GUI::Icon::default_icon("app-hack-studio"), window())); } NonnullRefPtr HackStudioWidget::create_stop_action() diff --git a/DevTools/Inspector/main.cpp b/DevTools/Inspector/main.cpp index 2e307920680..19819b725dd 100644 --- a/DevTools/Inspector/main.cpp +++ b/DevTools/Inspector/main.cpp @@ -28,7 +28,6 @@ #include "RemoteObjectGraphModel.h" #include "RemoteObjectPropertyModel.h" #include "RemoteProcess.h" -#include #include #include #include @@ -108,9 +107,7 @@ int main(int argc, char** argv) app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Inspector", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Inspector", app_icon, window)); auto& widget = window->set_main_widget(); widget.set_fill_with_background_color(true); diff --git a/DevTools/Playground/main.cpp b/DevTools/Playground/main.cpp index a2dd7cf571d..6f9786bf1a7 100644 --- a/DevTools/Playground/main.cpp +++ b/DevTools/Playground/main.cpp @@ -29,7 +29,6 @@ #include #include #include -#include #include #include #include @@ -349,9 +348,7 @@ int main(int argc, char** argv) help_menu.add_action(GUI::CommonActions::make_help_action([](auto&) { Desktop::Launcher::open(URL::create_with_file_protocol("/usr/share/man/man1/Playground.md"), "/bin/Help"); })); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("GML Playground", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("GML Playground", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/DevTools/Profiler/main.cpp b/DevTools/Profiler/main.cpp index 36b019fd553..fcef34ffbc8 100644 --- a/DevTools/Profiler/main.cpp +++ b/DevTools/Profiler/main.cpp @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include @@ -145,9 +144,7 @@ int main(int argc, char** argv) view_menu.add_action(percent_action); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Profiler", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Profiler", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Games/2048/main.cpp b/Games/2048/main.cpp index 3a6615f9e3a..e7bae59139c 100644 --- a/Games/2048/main.cpp +++ b/Games/2048/main.cpp @@ -28,7 +28,6 @@ #include "Game.h" #include "GameSizeDialog.h" #include -#include #include #include #include @@ -204,9 +203,7 @@ int main(int argc, char** argv) })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("2048", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("2048", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Games/Breakout/main.cpp b/Games/Breakout/main.cpp index 7ba4cf873f8..e4685cde40e 100644 --- a/Games/Breakout/main.cpp +++ b/Games/Breakout/main.cpp @@ -25,7 +25,6 @@ */ #include "Game.h" -#include #include #include #include @@ -83,9 +82,7 @@ int main(int argc, char** argv) })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](const GUI::Action&) { - GUI::AboutDialog::show("Breakout", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Breakout", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Games/Chess/main.cpp b/Games/Chess/main.cpp index 64545e944d5..213d5a8a4f2 100644 --- a/Games/Chess/main.cpp +++ b/Games/Chess/main.cpp @@ -27,7 +27,6 @@ #include "ChessWidget.h" #include #include -#include #include #include #include @@ -221,9 +220,7 @@ int main(int argc, char** argv) } auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Chess", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Chess", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Games/Conway/main.cpp b/Games/Conway/main.cpp index 133db22c5f0..ae57220f459 100644 --- a/Games/Conway/main.cpp +++ b/Games/Conway/main.cpp @@ -25,7 +25,6 @@ */ #include "Game.h" -#include #include #include #include @@ -81,9 +80,7 @@ int main(int argc, char** argv) })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Conway", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Conway", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Games/Minesweeper/main.cpp b/Games/Minesweeper/main.cpp index 83d808d3071..b4202ed8672 100644 --- a/Games/Minesweeper/main.cpp +++ b/Games/Minesweeper/main.cpp @@ -26,7 +26,6 @@ #include "Field.h" #include -#include #include #include #include @@ -141,9 +140,7 @@ int main(int argc, char** argv) })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Minesweeper", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Minesweeper", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Games/Pong/main.cpp b/Games/Pong/main.cpp index 13c5267a53f..f4b7c235f14 100644 --- a/Games/Pong/main.cpp +++ b/Games/Pong/main.cpp @@ -26,7 +26,6 @@ #include "Game.h" #include -#include #include #include #include @@ -83,9 +82,7 @@ int main(int argc, char** argv) })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](const GUI::Action&) { - GUI::AboutDialog::show("Pong", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Pong", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Games/Snake/main.cpp b/Games/Snake/main.cpp index 82437dfc42a..220f44e87ec 100644 --- a/Games/Snake/main.cpp +++ b/Games/Snake/main.cpp @@ -26,7 +26,6 @@ #include "SnakeGame.h" #include -#include #include #include #include @@ -91,9 +90,7 @@ int main(int argc, char** argv) })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Snake", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Snake", app_icon, window)); app->set_menubar(move(menubar)); diff --git a/Games/Solitaire/main.cpp b/Games/Solitaire/main.cpp index 741c08aaaec..de04b182182 100644 --- a/Games/Solitaire/main.cpp +++ b/Games/Solitaire/main.cpp @@ -25,7 +25,6 @@ */ #include "SolitaireWidget.h" -#include #include #include #include @@ -74,9 +73,7 @@ int main(int argc, char** argv) app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("Solitaire", app_icon.bitmap_for_size(32), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("Solitaire", app_icon, window)); app->set_menubar(move(menubar)); window->set_main_widget(widget); diff --git a/Userland/html.cpp b/Userland/html.cpp index 72a1199ec1d..b6e25244748 100644 --- a/Userland/html.cpp +++ b/Userland/html.cpp @@ -26,9 +26,9 @@ #include #include -#include #include #include +#include #include #include #include @@ -74,9 +74,7 @@ int main(int argc, char** argv) })); auto& help_menu = menubar->add_menu("Help"); - help_menu.add_action(GUI::Action::create("About", [&](auto&) { - GUI::AboutDialog::show("HTML", Gfx::Bitmap::load_from_file("/res/icons/32x32/filetype-html.png"), window); - })); + help_menu.add_action(GUI::CommonActions::make_about_action("HTML", GUI::Icon::default_icon("filetype-html"), window)); app->set_menubar(move(menubar));