summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Userland/Applications/Presenter/PresenterWidget.cpp9
-rw-r--r--Userland/Applications/Presenter/PresenterWidget.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/Userland/Applications/Presenter/PresenterWidget.cpp b/Userland/Applications/Presenter/PresenterWidget.cpp
index f2377d3200..52d3bf7719 100644
--- a/Userland/Applications/Presenter/PresenterWidget.cpp
+++ b/Userland/Applications/Presenter/PresenterWidget.cpp
@@ -100,8 +100,17 @@ ErrorOr<void> PresenterWidget::initialize_menubar()
auto* window = this->window();
window->set_fullscreen(!window->is_fullscreen());
});
+ m_resize_to_fit_content_action = GUI::Action::create("Resize to Fit &Content", { KeyModifier::Mod_Alt, KeyCode::Key_C }, TRY(Gfx::Bitmap::load_from_file("/res/icons/16x16/scale.png"sv)), [this](auto&) {
+ if (m_current_presentation) {
+ auto presentation_size = m_current_presentation->normative_size();
+ auto* window = this->window();
+
+ window->resize(window->size().match_aspect_ratio(presentation_size.aspect_ratio(), Orientation::Horizontal));
+ }
+ });
TRY(view_menu->try_add_action(*m_full_screen_action));
+ TRY(view_menu->try_add_action(*m_resize_to_fit_content_action));
update_slides_actions();
diff --git a/Userland/Applications/Presenter/PresenterWidget.h b/Userland/Applications/Presenter/PresenterWidget.h
index 45c2958395..b23795685e 100644
--- a/Userland/Applications/Presenter/PresenterWidget.h
+++ b/Userland/Applications/Presenter/PresenterWidget.h
@@ -49,4 +49,5 @@ private:
RefPtr<GUI::Action> m_present_from_first_slide_action;
RefPtr<GUI::Action> m_full_screen_action;
+ RefPtr<GUI::Action> m_resize_to_fit_content_action;
};