aboutsummaryrefslogtreecommitdiff
path: root/src/views.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/views.rs')
-rw-r--r--src/views.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/views.rs b/src/views.rs
index a306602..f02eb83 100644
--- a/src/views.rs
+++ b/src/views.rs
@@ -1,6 +1,6 @@
1use cursive::direction::Direction; 1use cursive::direction::Direction;
2use cursive::event::{Event, EventResult, Key}; 2use cursive::event::{Event, EventResult, Key};
3use cursive::theme::{ColorStyle, ColorType, Effect, Style}; 3use cursive::theme::{ColorStyle, Effect, Style};
4use cursive::view::View; 4use cursive::view::View;
5use cursive::{Printer, Vec2}; 5use cursive::{Printer, Vec2};
6 6
@@ -35,7 +35,7 @@ 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();
@@ -141,7 +141,7 @@ where
141 } 141 }
142 }; 142 };
143 143
144 match self.view_mode() { 144 match self.inner_data_ref().view_mode() {
145 ViewMode::Day => draw_day(printer), 145 ViewMode::Day => draw_day(printer),
146 ViewMode::Week => draw_week(printer), 146 ViewMode::Week => draw_week(printer),
147 _ => draw_day(printer), 147 _ => draw_day(printer),
@@ -157,7 +157,7 @@ where
157 } 157 }
158 158
159 fn on_event(&mut self, e: Event) -> EventResult { 159 fn on_event(&mut self, e: Event) -> EventResult {
160 let now = self.cursor().0; 160 let now = self.inner_data_mut_ref().cursor().0;
161 if self.is_auto() { 161 if self.is_auto() {
162 return EventResult::Ignored; 162 return EventResult::Ignored;
163 } 163 }