aboutsummaryrefslogtreecommitdiff
path: root/src/habit/mod.rs
blob: 5359bca54e6cf5371dc844aacc441f8e1087d94e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
use std::default::Default;

mod traits;
pub use traits::{Habit, HabitWrapper};

mod count;
pub use count::Count;

mod bit;
pub use bit::Bit;

mod float;
pub use float::Float;

mod prelude;
pub use prelude::{TrackEvent, ViewMode};

use crate::app::Cursor;

use cursive::direction::Absolute;

#[derive(Debug, Default)]
pub struct InnerData {
    pub cursor: Cursor,
    pub view_mode: ViewMode,
}

impl InnerData {
    pub fn move_cursor(&mut self, d: Absolute) {
        self.cursor.small_seek(d);
    }
    pub fn cursor(&self) -> Cursor {
        self.cursor
    }
    pub fn set_view_mode(&mut self, mode: ViewMode) {
        self.view_mode = mode;
    }
    pub fn view_mode(&self) -> ViewMode {
        self.view_mode
    }
}