diff options
Diffstat (limited to 'src/habit/mod.rs')
-rw-r--r-- | src/habit/mod.rs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/habit/mod.rs b/src/habit/mod.rs index 75e734a..d51abe5 100644 --- a/src/habit/mod.rs +++ b/src/habit/mod.rs | |||
@@ -1,3 +1,5 @@ | |||
1 | use std::default::Default; | ||
2 | |||
1 | mod traits; | 3 | mod traits; |
2 | pub use traits::{Habit, HabitWrapper}; | 4 | pub use traits::{Habit, HabitWrapper}; |
3 | 5 | ||
@@ -9,3 +11,28 @@ pub use bit::Bit; | |||
9 | 11 | ||
10 | mod prelude; | 12 | mod prelude; |
11 | pub use prelude::{TrackEvent, ViewMode}; | 13 | pub use prelude::{TrackEvent, ViewMode}; |
14 | |||
15 | use crate::app::Cursor; | ||
16 | |||
17 | use cursive::direction::Absolute; | ||
18 | |||
19 | #[derive(Debug, Default)] | ||
20 | pub struct InnerData { | ||
21 | pub cursor: Cursor, | ||
22 | pub view_mode: ViewMode, | ||
23 | } | ||
24 | |||
25 | impl InnerData { | ||
26 | pub fn move_cursor(&mut self, d: Absolute) { | ||
27 | self.cursor.small_seek(d); | ||
28 | } | ||
29 | pub fn cursor(&self) -> Cursor { | ||
30 | self.cursor | ||
31 | } | ||
32 | pub fn set_view_mode(&mut self, mode: ViewMode) { | ||
33 | self.view_mode = mode; | ||
34 | } | ||
35 | pub fn view_mode(&self) -> ViewMode { | ||
36 | self.view_mode | ||
37 | } | ||
38 | } | ||