mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-06 02:55:49 +03:00
PDFViewer: Reset current page number to 1 when opening a file
Also use set_current_number() instead of set_text(), so we don't have to create a string from the number ourselves.
This commit is contained in:
parent
a8d47d648c
commit
d2149c153c
Notes:
sideshowbarker
2024-07-18 17:18:10 +09:00
@ -110,8 +110,8 @@ void PDFViewerWidget::open_file(const String& path)
|
||||
m_total_page_label->set_text(String::formatted("of {}", document->get_page_count()));
|
||||
m_total_page_label->set_fixed_width(30);
|
||||
|
||||
m_page_text_box->set_text(String::number(m_viewer->current_page() + 1));
|
||||
m_page_text_box->set_enabled(true);
|
||||
m_page_text_box->set_current_number(1, false);
|
||||
m_page_text_box->set_max_number(document->get_page_count());
|
||||
m_go_to_prev_page_action->set_enabled(false);
|
||||
m_go_to_next_page_action->set_enabled(document->get_page_count() > 1);
|
||||
|
Loading…
Reference in New Issue
Block a user