1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 20:27:45 +00:00

PDFViewer: Show single/multi page actions on toolbar

These actions were being constructed, and they work, but were not shown
in the toolbar. Adding them will allow users to actually use them, as
well as pick up any bugs they might have.
This commit is contained in:
Rodrigo Tobar 2022-11-23 21:42:09 +08:00 committed by Andreas Kling
parent cbb373e135
commit 44c518e767

View file

@ -149,10 +149,12 @@ void PDFViewerWidget::initialize_toolbar(GUI::Toolbar& toolbar)
m_page_view_mode_single = GUI::Action::create_checkable("Single", [&](auto&) {
m_viewer->set_page_view_mode(PDFViewer::PageViewMode::Single);
});
m_page_view_mode_single->set_status_tip("Show single page at a time");
m_page_view_mode_multiple = GUI::Action::create_checkable("Multiple", [&](auto&) {
m_viewer->set_page_view_mode(PDFViewer::PageViewMode::Multiple);
});
m_page_view_mode_multiple->set_status_tip("Show multiple pages at a time");
if (m_viewer->page_view_mode() == PDFViewer::PageViewMode::Single) {
m_page_view_mode_single->set_checked(true);
@ -163,6 +165,9 @@ void PDFViewerWidget::initialize_toolbar(GUI::Toolbar& toolbar)
m_page_view_action_group.add_action(*m_page_view_mode_single);
m_page_view_action_group.add_action(*m_page_view_mode_multiple);
m_page_view_action_group.set_exclusive(true);
toolbar.add_action(*m_page_view_mode_single);
toolbar.add_action(*m_page_view_mode_multiple);
toolbar.add_separator();
toolbar.add_action(*m_zoom_in_action);
toolbar.add_action(*m_zoom_out_action);