mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 17:10:23 +00:00
Solitaire: Add about dialog and 32x32 icon
This commit is contained in:
parent
1448f4384d
commit
62422eecdc
Notes:
sideshowbarker
2024-07-19 08:20:12 +09:00
Author: https://github.com/tlmrgvf Commit: https://github.com/SerenityOS/serenity/commit/62422eecdce Pull-request: https://github.com/SerenityOS/serenity/pull/1434
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