diff options
author | Caoimhe <caoimhebyrne06@gmail.com> | 2023-03-19 19:59:49 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-03-21 10:10:29 +0100 |
commit | 72a45799e058d3a65da9e5bcbe5f08354eb98d9a (patch) | |
tree | dc24e3b25e9cd2bf9278bc43f9a94d2f5b4fbbda /Userland/Applications | |
parent | f2df495970258d035a1dad978beda472b4750d26 (diff) | |
download | serenity-72a45799e058d3a65da9e5bcbe5f08354eb98d9a.zip |
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.
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/Presenter/PresenterWidget.cpp | 13 | ||||
-rw-r--r-- | Userland/Applications/Presenter/PresenterWidget.h | 3 |
2 files changed, 10 insertions, 6 deletions
diff --git a/Userland/Applications/Presenter/PresenterWidget.cpp b/Userland/Applications/Presenter/PresenterWidget.cpp index 0c23b57ff0..f2377d3200 100644 --- a/Userland/Applications/Presenter/PresenterWidget.cpp +++ b/Userland/Applications/Presenter/PresenterWidget.cpp @@ -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")); diff --git a/Userland/Applications/Presenter/PresenterWidget.h b/Userland/Applications/Presenter/PresenterWidget.h index 051b929e57..45c2958395 100644 --- a/Userland/Applications/Presenter/PresenterWidget.h +++ b/Userland/Applications/Presenter/PresenterWidget.h @@ -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; }; |