mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 12:23:15 +00:00
Presenter: Add a "View" menu
It didn't really make sense for "Toggle Full Screen" to be under "Presentation", and now there's a place for any future view-related actions.
This commit is contained in:
parent
f2df495970
commit
72a45799e0
|
@ -83,10 +83,6 @@ ErrorOr<void> PresenterWidget::initialize_menubar()
|
|||
update_slides_actions();
|
||||
}
|
||||
});
|
||||
m_full_screen_action = GUI::Action::create("Toggle &Full Screen", { KeyModifier::Mod_Shift, KeyCode::Key_F5 }, { KeyCode::Key_F11 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/fullscreen.png"sv)), [this](auto&) {
|
||||
auto* window = this->window();
|
||||
window->set_fullscreen(!window->is_fullscreen());
|
||||
});
|
||||
m_present_from_first_slide_action = GUI::Action::create("Present From First &Slide", { KeyCode::Key_F5 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/play.png"sv)), [this](auto&) {
|
||||
if (m_current_presentation) {
|
||||
m_current_presentation->go_to_first_slide();
|
||||
|
@ -97,9 +93,16 @@ ErrorOr<void> PresenterWidget::initialize_menubar()
|
|||
|
||||
TRY(presentation_menu->try_add_action(*m_next_slide_action));
|
||||
TRY(presentation_menu->try_add_action(*m_previous_slide_action));
|
||||
TRY(presentation_menu->try_add_action(*m_full_screen_action));
|
||||
TRY(presentation_menu->try_add_action(*m_present_from_first_slide_action));
|
||||
|
||||
auto view_menu = TRY(window->try_add_menu("&View"));
|
||||
m_full_screen_action = GUI::Action::create("Toggle &Full Screen", { KeyModifier::Mod_Shift, KeyCode::Key_F5 }, { KeyCode::Key_F11 }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/fullscreen.png"sv)), [this](auto&) {
|
||||
auto* window = this->window();
|
||||
window->set_fullscreen(!window->is_fullscreen());
|
||||
});
|
||||
|
||||
TRY(view_menu->try_add_action(*m_full_screen_action));
|
||||
|
||||
update_slides_actions();
|
||||
|
||||
auto help_menu = TRY(window->try_add_menu("&Help"));
|
||||
|
|
|
@ -46,6 +46,7 @@ private:
|
|||
OwnPtr<Presentation> m_current_presentation;
|
||||
RefPtr<GUI::Action> m_next_slide_action;
|
||||
RefPtr<GUI::Action> m_previous_slide_action;
|
||||
RefPtr<GUI::Action> m_full_screen_action;
|
||||
RefPtr<GUI::Action> m_present_from_first_slide_action;
|
||||
|
||||
RefPtr<GUI::Action> m_full_screen_action;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue