mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-12 22:22:55 +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:
parent
e92ec26771
commit
bc7da24fe6
Notes:
sideshowbarker
2024-07-17 04:07:27 +09:00
Author: https://github.com/rtobar
Commit: bc7da24fe6
Pull-request: https://github.com/SerenityOS/serenity/pull/16155
4 changed files with 26 additions and 4 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue