diff options
-rw-r--r-- | src/app.rs | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -30,6 +30,8 @@ impl std::default::Default for ViewMode { | |||
30 | #[derive(Serialize, Deserialize)] | 30 | #[derive(Serialize, Deserialize)] |
31 | pub struct App { | 31 | pub struct App { |
32 | habits: Vec<Box<dyn HabitWrapper>>, | 32 | habits: Vec<Box<dyn HabitWrapper>>, |
33 | |||
34 | #[serde(skip)] | ||
33 | focus: usize, | 35 | focus: usize, |
34 | 36 | ||
35 | #[serde(skip)] | 37 | #[serde(skip)] |
@@ -116,7 +118,7 @@ impl App { | |||
116 | Vec2::new(width, height) | 118 | Vec2::new(width, height) |
117 | } | 119 | } |
118 | 120 | ||
119 | fn load_state() -> Self { | 121 | pub fn load_state() -> Self { |
120 | let mut file = File::open("foo.txt").unwrap(); | 122 | let mut file = File::open("foo.txt").unwrap(); |
121 | let mut j = String::new(); | 123 | let mut j = String::new(); |
122 | file.read_to_string(&mut j); | 124 | file.read_to_string(&mut j); |
@@ -143,7 +145,7 @@ impl View for App { | |||
143 | i.draw(&printer.offset(offset).focused(self.focus == idx)); | 145 | i.draw(&printer.offset(offset).focused(self.focus == idx)); |
144 | offset = offset.map_x(|x| x + CONFIGURATION.view_width); | 146 | offset = offset.map_x(|x| x + CONFIGURATION.view_width); |
145 | } | 147 | } |
146 | offset = offset.map_x(|_| 0).map_y(|_| self.max_size().y - 2); | 148 | offset = offset.map_x(|_| 0).map_y(|_| self.max_size().y - 1); |
147 | printer.print(offset, &self.status()); | 149 | printer.print(offset, &self.status()); |
148 | } | 150 | } |
149 | 151 | ||