diff options
author | Akshay <nerdy@peppe.rs> | 2020-06-29 15:28:35 +0530 |
---|---|---|
committer | Akshay <nerdy@peppe.rs> | 2020-06-29 15:28:35 +0530 |
commit | ae9927db2acb96a0cb3a3e1f867c11c565d3bc10 (patch) | |
tree | 0ae12316a69209a512b10fd1b579149c10b40f25 | |
parent | a97a4d42bb30b76589c7195de8b10ca3c2090deb (diff) |
fix overlapping widget issue
-rw-r--r-- | src/app.rs | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -30,6 +30,8 @@ impl std::default::Default for ViewMode { #[derive(Serialize, Deserialize)] pub struct App { habits: Vec<Box<dyn HabitWrapper>>, + + #[serde(skip)] focus: usize, #[serde(skip)] @@ -116,7 +118,7 @@ impl App { Vec2::new(width, height) } - fn load_state() -> Self { + pub fn load_state() -> Self { let mut file = File::open("foo.txt").unwrap(); let mut j = String::new(); file.read_to_string(&mut j); @@ -143,7 +145,7 @@ impl View for App { i.draw(&printer.offset(offset).focused(self.focus == idx)); offset = offset.map_x(|x| x + CONFIGURATION.view_width); } - offset = offset.map_x(|_| 0).map_y(|_| self.max_size().y - 2); + offset = offset.map_x(|_| 0).map_y(|_| self.max_size().y - 1); printer.print(offset, &self.status()); } |