1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:07:46 +00:00

Games: Add fullscreen option

This commit is contained in:
Hugh Davenport 2024-01-05 09:12:37 +13:00 committed by Andrew Kaster
parent 13c66ebf12
commit 64edf6913f
13 changed files with 66 additions and 0 deletions

View file

@ -82,10 +82,14 @@ void Game::paint_event(GUI::PaintEvent& event)
void Game::keydown_event(GUI::KeyEvent& event)
{
// FIXME: After #22573 is merged, then remove the case for F11 below and ensure it is in this check here which also checks for modifiers
switch (event.key()) {
case Key_Escape:
GUI::Application::the()->quit();
break;
case Key_F11:
event.ignore();
break;
default:
player_input();
break;

View file

@ -60,6 +60,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
GUI::Application::the()->quit();
}));
auto view_menu = window->add_menu("&View"_string);
view_menu->add_action(GUI::CommonActions::make_fullscreen_action([&](auto&) {
window->set_fullscreen(!window->is_fullscreen());
}));
auto help_menu = window->add_menu("&Help"_string);
help_menu->add_action(GUI::CommonActions::make_command_palette_action(window));
help_menu->add_action(GUI::CommonActions::make_help_action([](auto&) {