diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 4 | ||||
-rw-r--r-- | src/view.rs | 10 |
2 files changed, 7 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs index fedcdc6..1b4c351 100644 --- a/src/main.rs +++ b/src/main.rs @@ -18,7 +18,7 @@ use std::{ use unicode_width::UnicodeWidthChar; mod view; -use view::{Nav, Page, Search, View}; +use view::{Toc, Page, Search, View}; mod epub; use epub::Chapter; @@ -146,7 +146,7 @@ impl Bk<'_> { cols, rows: rows as usize, max_width: args.width, - view: Some(if args.toc { &Nav } else { &Page }), + view: Some(if args.toc { &Toc } else { &Page }), cursor: 0, dir: Direction::Next, meta, diff --git a/src/view.rs b/src/view.rs index 1bc5ca9..50af1c6 100644 --- a/src/view.rs +++ b/src/view.rs @@ -106,8 +106,8 @@ PageDown Right Space f l Page Down } } -pub struct Nav; -impl Nav { +pub struct Toc; +impl Toc { fn prev(&self, bk: &mut Bk, n: usize) { bk.chapter = bk.chapter.saturating_sub(n); self.cursor(bk); @@ -128,7 +128,7 @@ impl Nav { } } } -impl View for Nav { +impl View for Toc { fn on_resize(&self, bk: &mut Bk) { self.cursor(bk); } @@ -238,8 +238,8 @@ impl View for Page { Esc | Char('q') => bk.view = None, Tab => { bk.mark('\''); - Nav.cursor(bk); - bk.view = Some(&Nav); + Toc.cursor(bk); + bk.view = Some(&Toc); } F(_) => bk.view = Some(&Help), Char('m') => bk.view = Some(&Mark), |