MasterWord: Add fullscreen option

Required allowing resizing. Perhaps an additional setting to allow
fullscreen, but not resizing? Anyhow, the game still plays well if
you can resize and works as expected.
This commit is contained in:
Hugh Davenport 2024-01-05 09:59:35 +13:00 committed by Andrew Kaster
parent 5f56c946c2
commit 7dba28fce8
Notes: sideshowbarker 2024-07-16 23:08:48 +09:00

View file

@ -44,7 +44,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
window->set_icon(app_icon.bitmap_for_size(16));
window->set_double_buffering_enabled(false);
window->set_title("MasterWord");
window->set_resizable(false);
window->set_resizable(true);
window->set_auto_shrink(true);
auto main_widget = TRY(MasterWord::MainWidget::try_create());
@ -127,6 +127,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
theme_actions.add_action(system_theme_action);
theme_actions.add_action(wordle_theme_action);
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&) {