Solitaire: Add about dialog and 32x32 icon

This commit is contained in:
Till Mayer 2020-03-12 22:53:37 +01:00 committed by Andreas Kling
parent 1448f4384d
commit 62422eecdc
Notes: sideshowbarker 2024-07-19 08:20:12 +09:00
2 changed files with 8 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

View file

@ -25,6 +25,7 @@
*/
#include "SolitaireWidget.h"
#include <LibGUI/AboutDialog.h>
#include <LibGUI/Action.h>
#include <LibGUI/Application.h>
#include <LibGUI/Menu.h>
@ -52,11 +53,18 @@ int main(int argc, char** argv)
auto menu_bar = make<GUI::MenuBar>();
auto app_menu = GUI::Menu::construct("Solitaire");
auto help_menu = GUI::Menu::construct("Help");
app_menu->add_action(GUI::Action::create("Restart game", [&](auto&) { widget->setup(); }));
app_menu->add_separator();
app_menu->add_action(GUI::CommonActions::make_quit_action([&](auto&) { app.quit(); }));
help_menu->add_action(GUI::Action::create("About", [&](auto&) {
GUI::AboutDialog::show("Solitaire", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-solitaire.png"));
}));
menu_bar->add_menu(move(app_menu));
menu_bar->add_menu(move(help_menu));
app.set_menubar(move(menu_bar));
window->set_main_widget(widget);