aboutsummaryrefslogtreecommitdiff
path: root/src/views.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/views.rs')
-rw-r--r--src/views.rs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/views.rs b/src/views.rs
index b18e960..77006b7 100644
--- a/src/views.rs
+++ b/src/views.rs
@@ -33,15 +33,22 @@ where
33 let todo_style = Style::from(CONFIGURATION.todo_color); 33 let todo_style = Style::from(CONFIGURATION.todo_color);
34 let future_style = Style::from(CONFIGURATION.future_color); 34 let future_style = Style::from(CONFIGURATION.future_color);
35 35
36 let goal_reached_today = self.reached_goal(Local::now().naive_utc().date());
37 if goal_reached_today {
38 printer.with_style(goal_reached_style, |p| p.print((0, 0), "o"));
39 } else {
40 printer.with_style(todo_style, |p| p.print((0, 0), "x"));
41 }
42
36 printer.with_style( 43 printer.with_style(
37 if !printer.focused { 44 if !printer.focused {
38 future_style 45 future_style
39 } else { 46 } else {
40 goal_reached_style 47 Style::none()
41 }, 48 },
42 |p| { 49 |p| {
43 p.print( 50 p.print(
44 (0, 0), 51 (2, 0),
45 &format!("{:width$}", self.name(), width = CONFIGURATION.view_width), 52 &format!("{:width$}", self.name(), width = CONFIGURATION.view_width),
46 ) 53 )
47 }, 54 },