mirror of
https://github.com/fergalmoran/ladybird.git
synced 2025-12-26 03:09:08 +00:00
PDFViewer: Let users change clipping paths visibility
Now that the Renderer accepts preferences, PDFViewer can offer ways for changing these preferences. The first step in this direction is to add a checkbox that allows toggling whether clipping paths are visible or not. A Config item has also been added to remember this setting.
This commit is contained in:
committed by
Andreas Kling
parent
e92ec26771
commit
bc7da24fe6
@@ -167,6 +167,12 @@ void PDFViewerWidget::initialize_toolbar(GUI::Toolbar& toolbar)
|
||||
toolbar.add_action(*m_reset_zoom_action);
|
||||
toolbar.add_action(*m_rotate_counterclockwise_action);
|
||||
toolbar.add_action(*m_rotate_clockwise_action);
|
||||
toolbar.add_separator();
|
||||
|
||||
m_show_clipping_paths = toolbar.add<GUI::CheckBox>();
|
||||
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); };
|
||||
}
|
||||
|
||||
void PDFViewerWidget::open_file(Core::File& file)
|
||||
@@ -214,6 +220,7 @@ void PDFViewerWidget::open_file(Core::File& file)
|
||||
m_reset_zoom_action->set_enabled(true);
|
||||
m_rotate_counterclockwise_action->set_enabled(true);
|
||||
m_rotate_clockwise_action->set_enabled(true);
|
||||
m_show_clipping_paths->set_checked(m_viewer->show_clipping_paths(), GUI::AllowCallback::No);
|
||||
|
||||
if (document->outline()) {
|
||||
auto outline = document->outline();
|
||||
|
||||
Reference in New Issue
Block a user