diff options
Diffstat (limited to 'src/views.rs')
-rw-r--r-- | src/views.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/views.rs b/src/views.rs index a306602..b90ce2b 100644 --- a/src/views.rs +++ b/src/views.rs | |||
@@ -1,6 +1,6 @@ | |||
1 | use cursive::direction::Direction; | 1 | use cursive::direction::Direction; |
2 | use cursive::event::{Event, EventResult, Key}; | 2 | use cursive::event::{Event, EventResult, Key}; |
3 | use cursive::theme::{ColorStyle, ColorType, Effect, Style}; | 3 | use cursive::theme::{ColorStyle, Effect, Style}; |
4 | use cursive::view::View; | 4 | use cursive::view::View; |
5 | use cursive::{Printer, Vec2}; | 5 | use cursive::{Printer, Vec2}; |
6 | 6 | ||
@@ -35,13 +35,12 @@ where | |||
35 | // .checked_sub_signed(Duration::weeks(4 * self.view_month_offset() as i64)) | 35 | // .checked_sub_signed(Duration::weeks(4 * self.view_month_offset() as i64)) |
36 | // .unwrap() | 36 | // .unwrap() |
37 | // }; | 37 | // }; |
38 | let now = self.cursor().0; | 38 | let now = self.inner_data_ref().cursor().0; |
39 | let is_today = now == Local::now().naive_local().date(); | 39 | let is_today = now == Local::now().naive_local().date(); |
40 | let year = now.year(); | 40 | let year = now.year(); |
41 | let month = now.month(); | 41 | let month = now.month(); |
42 | 42 | ||
43 | let goal_reached_style = Style::from(CONFIGURATION.reached_color()); | 43 | let goal_reached_style = Style::from(CONFIGURATION.reached_color()); |
44 | let todo_style = Style::from(CONFIGURATION.todo_color()); | ||
45 | let future_style = Style::from(CONFIGURATION.inactive_color()); | 44 | let future_style = Style::from(CONFIGURATION.inactive_color()); |
46 | 45 | ||
47 | let strikethrough = Style::from(Effect::Strikethrough); | 46 | let strikethrough = Style::from(Effect::Strikethrough); |
@@ -141,7 +140,7 @@ where | |||
141 | } | 140 | } |
142 | }; | 141 | }; |
143 | 142 | ||
144 | match self.view_mode() { | 143 | match self.inner_data_ref().view_mode() { |
145 | ViewMode::Day => draw_day(printer), | 144 | ViewMode::Day => draw_day(printer), |
146 | ViewMode::Week => draw_week(printer), | 145 | ViewMode::Week => draw_week(printer), |
147 | _ => draw_day(printer), | 146 | _ => draw_day(printer), |
@@ -157,7 +156,7 @@ where | |||
157 | } | 156 | } |
158 | 157 | ||
159 | fn on_event(&mut self, e: Event) -> EventResult { | 158 | fn on_event(&mut self, e: Event) -> EventResult { |
160 | let now = self.cursor().0; | 159 | let now = self.inner_data_mut_ref().cursor().0; |
161 | if self.is_auto() { | 160 | if self.is_auto() { |
162 | return EventResult::Ignored; | 161 | return EventResult::Ignored; |
163 | } | 162 | } |