mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 22:57:44 +00:00
Games: Use GUI::Icon::default_icon to set application icon
This commit is contained in:
parent
27ead7e2c2
commit
7c5e488de2
5 changed files with 23 additions and 12 deletions
|
@ -28,6 +28,7 @@
|
|||
#include <LibGUI/AboutDialog.h>
|
||||
#include <LibGUI/Action.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Icon.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/MenuBar.h>
|
||||
#include <LibGUI/Window.h>
|
||||
|
@ -37,6 +38,7 @@
|
|||
int main(int argc, char** argv)
|
||||
{
|
||||
auto app = GUI::Application::construct(argc, argv);
|
||||
auto app_icon = GUI::Icon::default_icon("app-solitaire");
|
||||
|
||||
if (pledge("stdio rpath shared_buffer", nullptr) < 0) {
|
||||
perror("pledge");
|
||||
|
@ -63,12 +65,12 @@ 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("Solitaire", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-solitaire.png"), window);
|
||||
GUI::AboutDialog::show("Solitaire", app_icon.bitmap_for_size(32), window);
|
||||
}));
|
||||
|
||||
app->set_menubar(move(menubar));
|
||||
window->set_main_widget(widget);
|
||||
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-solitaire.png"));
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
window->show();
|
||||
widget->setup();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue