diff options
author | Linus Groh <mail@linusgroh.de> | 2021-05-27 18:49:49 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2021-05-27 18:49:49 +0100 |
commit | d2149c153c444d1e4d639b3dbd6824b58c2c6faa (patch) | |
tree | 62fa071b482a08653be93a38cea7229f378aa02b /Userland/Applications | |
parent | a8d47d648c0a57ade2c81f8cd60340e3a38b6524 (diff) | |
download | serenity-d2149c153c444d1e4d639b3dbd6824b58c2c6faa.zip |
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.
Diffstat (limited to 'Userland/Applications')
-rw-r--r-- | Userland/Applications/PDFViewer/PDFViewerWidget.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Applications/PDFViewer/PDFViewerWidget.cpp b/Userland/Applications/PDFViewer/PDFViewerWidget.cpp index 96addf693c..2a55b4c5e5 100644 --- a/Userland/Applications/PDFViewer/PDFViewerWidget.cpp +++ b/Userland/Applications/PDFViewer/PDFViewerWidget.cpp @@ -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); |