mirror of
https://github.com/SerenityOS/serenity
synced 2024-11-05 17:46:52 +00:00
Solitaire: Add about dialog and 32x32 icon
This commit is contained in:
parent
1448f4384d
commit
62422eecdc
2 changed files with 8 additions and 0 deletions
BIN
Base/res/icons/32x32/app-solitaire.png
Normal file
BIN
Base/res/icons/32x32/app-solitaire.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue