1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 12:07: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:
inalone 2021-04-30 23:53:18 +01:00 committed by Linus Groh
parent 51f88cb00d
commit 4dbf40399b
3 changed files with 24 additions and 0 deletions

View file

@ -23,9 +23,12 @@
*/
#include <LibCore/ElapsedTimer.h>
#include <LibGUI/Action.h>
#include <LibGUI/Application.h>
#include <LibGUI/Icon.h>
#include <LibGUI/Label.h>
#include <LibGUI/Menu.h>
#include <LibGUI/Menubar.h>
#include <LibGUI/Painter.h>
#include <LibGUI/Widget.h>
#include <LibGUI/Window.h>
@ -218,6 +221,11 @@ int main(int argc, char** argv)
window->set_resizable(false);
window->resize(640, 400);
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& fire = window->set_main_widget<Fire>();
auto& time = fire.add<GUI::Label>();