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

PDFViewer: Update the page number when scrolling between pages

This commit is contained in:
FalseHonesty 2021-06-20 15:07:44 -04:00 committed by Ali Mohammad Pur
parent 395bee07e0
commit 4f0a75224c
3 changed files with 9 additions and 0 deletions

View file

@ -90,6 +90,8 @@ void PDFViewer::mousewheel_event(GUI::MouseEvent& event)
if (scrollbar.value() == scrollbar.max()) {
if (m_current_page_index < m_document->get_page_count() - 1) {
m_current_page_index++;
if (on_page_change)
on_page_change(m_current_page_index);
scrollbar.set_value(0);
}
} else {
@ -99,6 +101,8 @@ void PDFViewer::mousewheel_event(GUI::MouseEvent& event)
if (scrollbar.value() == 0) {
if (m_current_page_index > 0) {
m_current_page_index--;
if (on_page_change)
on_page_change(m_current_page_index);
scrollbar.set_value(scrollbar.max());
}
} else {