Skip to content

Commit

Permalink
Go to the first/last page when holding prev/next
Browse files Browse the repository at this point in the history
  • Loading branch information
baskerville committed Mar 14, 2018
1 parent d4647a9 commit ce730e7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions doc/MANUAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
- Swipe west/east to go to the next/previous page.
- Tap on a book entry to open it.

## Bottom bar

Hold the next/previous page icon to go the last/first page.

# Reader

## Viewer
Expand Down
8 changes: 8 additions & 0 deletions src/view/home/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -957,6 +957,14 @@ impl View for Home {
self.go_to_page(index, hub);
true
},
Event::Chapter(dir) => {
let pages_count = self.pages_count;
match dir {
CycleDir::Previous => self.go_to_page(0, hub),
CycleDir::Next => self.go_to_page(pages_count.saturating_sub(1), hub),
}
true
},
Event::Page(dir) => {
self.set_current_page(dir, hub);
true
Expand Down

0 comments on commit ce730e7

Please sign in to comment.