aboutsummaryrefslogtreecommitdiff
path: root/src/app.rs
diff options
context:
space:
mode:
authorAkshay <[email protected]>2020-06-29 10:58:35 +0100
committerAkshay <[email protected]>2020-06-29 10:58:35 +0100
commitae9927db2acb96a0cb3a3e1f867c11c565d3bc10 (patch)
tree0ae12316a69209a512b10fd1b579149c10b40f25 /src/app.rs
parenta97a4d42bb30b76589c7195de8b10ca3c2090deb (diff)
fix overlapping widget issue
Diffstat (limited to 'src/app.rs')
-rw-r--r--src/app.rs6
1 files changed, 4 insertions, 2 deletions
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 {
30#[derive(Serialize, Deserialize)] 30#[derive(Serialize, Deserialize)]
31pub struct App { 31pub 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