DevTools: Add fullscreen option

All except SQLStudio, as that causes a crash
This commit is contained in:
Hugh Davenport 2024-01-05 08:57:23 +13:00 committed by Andrew Kaster
parent eb5e8ac11b
commit 13c66ebf12
Notes: sideshowbarker 2024-07-17 07:16:27 +09:00
6 changed files with 29 additions and 0 deletions

View file

@ -794,6 +794,11 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
scale_menu->add_action(*m_scale_ten_action);
scale_menu->add_action(*m_scale_fifteen_action);
view_menu->add_separator();
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&) {

View file

@ -210,6 +210,11 @@ ErrorOr<void> MainWidget::initialize_fallibles(GUI::Window& window)
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 go_menu = window.add_menu("&Go"_string);
go_menu->add_action(*m_go_back_action);
go_menu->add_action(*m_go_forward_action);

View file

@ -555,6 +555,11 @@ ErrorOr<void> HexEditorWidget::initialize_menubar(GUI::Window& window)
little_endian_mode->set_checked(use_little_endian);
big_endian_mode->set_checked(!use_little_endian);
view_menu->add_separator();
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&) {

View file

@ -94,6 +94,11 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto settings_menu = window->add_menu("&Settings"_string);
settings_menu->add_action(auto_modifier_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_about_action("Keyboard Mapper"_string, app_icon, window));

View file

@ -305,6 +305,11 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
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());
}));
window.add_menu(GUI::CommonMenus::make_accessibility_menu(*m_preview_widget));
auto help_menu = window.add_menu("&Help"_string);

View file

@ -267,6 +267,10 @@ ErrorOr<void> MainWidget::initialize_menubar(GUI::Window& window)
});
view_menu->add_action(*m_view_window_action);
m_views_group.add_action(*m_view_window_action);
view_menu->add_separator();
view_menu->add_action(GUI::CommonActions::make_fullscreen_action([&](auto&) {
window.set_fullscreen(!window.is_fullscreen());
}));
m_preview_window->on_close = [&] {
m_view_frame_action->activate();