From ae9927db2acb96a0cb3a3e1f867c11c565d3bc10 Mon Sep 17 00:00:00 2001 From: Akshay Date: Mon, 29 Jun 2020 15:28:35 +0530 Subject: fix overlapping widget issue --- src/app.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/app.rs b/src/app.rs index 710b25a..5ba00bf 100644 --- a/src/app.rs +++ b/src/app.rs @@ -30,6 +30,8 @@ impl std::default::Default for ViewMode { #[derive(Serialize, Deserialize)] pub struct App { habits: Vec>, + + #[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()); } -- cgit v1.2.3