mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 23:17:45 +00:00
Demos: Added Alt+F4 funtionality to demos that lacked it
The Fire, LibGfxDemo and LibGfxScaleDemo demos did not have Alt+F4 functionality as they lacked menubars - I just added basic menubars with Quit entries to allow this shortcut with the demos that didn't have it.
This commit is contained in:
parent
51f88cb00d
commit
4dbf40399b
3 changed files with 24 additions and 0 deletions
|
@ -4,8 +4,11 @@
|
|||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <LibGUI/Action.h>
|
||||
#include <LibGUI/Application.h>
|
||||
#include <LibGUI/Icon.h>
|
||||
#include <LibGUI/Menu.h>
|
||||
#include <LibGUI/Menubar.h>
|
||||
#include <LibGUI/Painter.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
#include <LibGUI/Window.h>
|
||||
|
@ -201,6 +204,11 @@ int main(int argc, char** argv)
|
|||
window->set_resizable(false);
|
||||
window->resize(WIDTH, HEIGHT);
|
||||
|
||||
auto menubar = GUI::Menubar::construct();
|
||||
auto& app_menu = menubar->add_menu("File");
|
||||
app_menu.add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->quit(); }));
|
||||
window->set_menubar(move(menubar));
|
||||
|
||||
auto app_icon = GUI::Icon::default_icon("app-libgfx-demo");
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
window->set_main_widget<Canvas>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue