From ee88fa8e3488b64f930632cefbc5115cf3a406e0 Mon Sep 17 00:00:00 2001 From: Marek Kasik Date: Fri, 31 Jan 2025 12:57:37 +0100 Subject: [PATCH 2/2] shell: Extend fast navigation Enable navigation to the beginning of the document for "go-backwards" action even if the page number is lower than 10. Enable the same for "go-forward" action for the end of the document. --- shell/src/document_view/actions.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/shell/src/document_view/actions.rs b/shell/src/document_view/actions.rs index a4036ab92..006b9f58f 100644 --- a/shell/src/document_view/actions.rs +++ b/shell/src/document_view/actions.rs @@ -655,6 +655,8 @@ impl imp::PpsDocumentView { if current_page + 10 < n_pages { obj.model.set_page(current_page + 10); + } else { + obj.model.set_page(n_pages - 1); } } )) @@ -668,6 +670,8 @@ impl imp::PpsDocumentView { if current_page - 10 >= 0 { obj.model.set_page(current_page - 10); + } else { + obj.model.set_page(0); } } )) -- 2.48.1