mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-26 01:20:25 +00:00
Demos: Add fullscreen option to those that don't
Missing are the Model Gallery and Widget Gallery, as they don't have a menu bar.
This commit is contained in:
parent
8bb6dc9c4b
commit
eb5e8ac11b
Notes:
sideshowbarker
2024-07-16 16:23:32 +09:00
Author: https://github.com/hughdavenport Commit: https://github.com/SerenityOS/serenity/commit/eb5e8ac11b Pull-request: https://github.com/SerenityOS/serenity/pull/22591 Reviewed-by: https://github.com/ADKaster ✅
4 changed files with 18 additions and 0 deletions
|
@ -200,6 +200,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto file_menu = window->add_menu("&File"_string);
|
||||
file_menu->add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->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 app_icon = TRY(GUI::Icon::try_create_default_icon("app-libgfx-demo"sv));
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
(void)window->set_main_widget<Canvas>();
|
||||
|
|
|
@ -119,6 +119,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
auto file_menu = window->add_menu("&File"_string);
|
||||
file_menu->add_action(GUI::CommonActions::make_quit_action([&](auto&) { app->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 app_icon = TRY(GUI::Icon::try_create_default_icon("app-libgfx-demo"sv));
|
||||
window->set_icon(app_icon.bitmap_for_size(16));
|
||||
(void)window->set_main_widget<Canvas>();
|
||||
|
|
|
@ -510,6 +510,9 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
view_menu->add_action(zoom_in_action);
|
||||
view_menu->add_action(reset_zoom_action);
|
||||
view_menu->add_action(zoom_out_action);
|
||||
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));
|
||||
|
|
|
@ -81,6 +81,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
|
|||
app->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_about_action("Screensaver"_string, app_icon, window));
|
||||
|
|
Loading…
Reference in a new issue