Ladybird: Set pageStep for scroll bars in WebView

This allows PageUp/PageDown keys to scroll 1 viewport size at a time.
This also fixes the scroll bar drag handle to be a correct length.
This commit is contained in:
Thitat Auareesuksakul 2022-07-09 00:57:39 +07:00 committed by Andrew Kaster
parent 096164ea1a
commit d89fbf3aa0
Notes: sideshowbarker 2024-07-17 11:30:54 +09:00

View file

@ -248,7 +248,9 @@ public:
content_size = enclosing_int_rect(layout_root->paint_box()->absolute_rect()).size();
m_view.verticalScrollBar()->setMaximum(content_size.height() - m_viewport_rect.height());
m_view.verticalScrollBar()->setPageStep(m_viewport_rect.height());
m_view.horizontalScrollBar()->setMaximum(content_size.width() - m_viewport_rect.width());
m_view.horizontalScrollBar()->setPageStep(m_viewport_rect.width());
}
virtual void page_did_request_scroll_into_view(Gfx::IntRect const&) override