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 @@ use cursive::direction::Direction; use cursive::event::{Event, EventResult, Key}; -use cursive::theme::{ColorStyle, ColorType, Effect, Style}; +use cursive::theme::{ColorStyle, Effect, Style}; use cursive::view::View; use cursive::{Printer, Vec2}; @@ -35,13 +35,12 @@ where // .checked_sub_signed(Duration::weeks(4 * self.view_month_offset() as i64)) // .unwrap() // }; - let now = self.cursor().0; + let now = self.inner_data_ref().cursor().0; let is_today = now == Local::now().naive_local().date(); let year = now.year(); let month = now.month(); let goal_reached_style = Style::from(CONFIGURATION.reached_color()); - let todo_style = Style::from(CONFIGURATION.todo_color()); let future_style = Style::from(CONFIGURATION.inactive_color()); let strikethrough = Style::from(Effect::Strikethrough); @@ -141,7 +140,7 @@ where } }; - match self.view_mode() { + match self.inner_data_ref().view_mode() { ViewMode::Day => draw_day(printer), ViewMode::Week => draw_week(printer), _ => draw_day(printer), @@ -157,7 +156,7 @@ where } fn on_event(&mut self, e: Event) -> EventResult { - let now = self.cursor().0; + let now = self.inner_data_mut_ref().cursor().0; if self.is_auto() { return EventResult::Ignored; } |