1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:28:10 +00:00

PDFViewer: Let users change image rendering

A new checkbox in the toolbar now allows users toggle image rendering. A
corresponding Config option makes this setting non-volatile. To void
clashing with the previous "show_clipping_paths" option when caching a
Page, we now use the RenderingPreferences.hash() and the pair_int_hash
funcitons to compute a unique key into the page cache map for a given
RenderingPreferences and zoom level.
This commit is contained in:
Rodrigo Tobar 2022-11-25 02:11:06 +08:00 committed by Andreas Kling
parent adc45635e9
commit 67b50d7994
4 changed files with 17 additions and 1 deletions

View file

@ -180,6 +180,10 @@ void PDFViewerWidget::initialize_toolbar(GUI::Toolbar& toolbar)
m_show_clipping_paths->set_text("Show clipping paths");
m_show_clipping_paths->set_checked(m_viewer->show_clipping_paths(), GUI::AllowCallback::No);
m_show_clipping_paths->on_checked = [&](auto checked) { m_viewer->set_show_clipping_paths(checked); };
m_show_images = toolbar.add<GUI::CheckBox>();
m_show_images->set_text("Show images");
m_show_images->set_checked(m_viewer->show_images(), GUI::AllowCallback::No);
m_show_images->on_checked = [&](auto checked) { m_viewer->set_show_images(checked); };
}
void PDFViewerWidget::open_file(Core::File& file)