From 77368eed146ec8278609e04e395c7ef04c386313 Mon Sep 17 00:00:00 2001 From: Akshay Date: Sat, 6 Feb 2021 19:00:40 +0530 Subject: deprecate view_month_offset in favor of cursor --- src/app/impl_view.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/app/impl_view.rs') diff --git a/src/app/impl_view.rs b/src/app/impl_view.rs index 0ec47f1..db05432 100644 --- a/src/app/impl_view.rs +++ b/src/app/impl_view.rs @@ -117,7 +117,7 @@ impl View for App { if self.habits.is_empty() { return EventResult::Consumed(None); } - if self.habits[self.focus].view_mode() == ViewMode::Week { + if self.habits[self.focus].inner_data_ref().view_mode() == ViewMode::Week { self.set_mode(ViewMode::Day) } else { self.set_mode(ViewMode::Week) @@ -126,13 +126,13 @@ impl View for App { } Event::Char('V') => { for habit in self.habits.iter_mut() { - habit.set_view_mode(ViewMode::Week); + habit.inner_data_mut_ref().set_view_mode(ViewMode::Week); } return EventResult::Consumed(None); } Event::Key(Key::Esc) => { for habit in self.habits.iter_mut() { - habit.set_view_mode(ViewMode::Day); + habit.inner_data_mut_ref().set_view_mode(ViewMode::Day); } return EventResult::Consumed(None); } @@ -149,7 +149,7 @@ impl View for App { return EventResult::Consumed(None); } Event::Char('}') => { - self.set_view_month_offset(0); + self.reset_cursor(); return EventResult::Consumed(None); } Event::CtrlChar('l') => { @@ -166,7 +166,7 @@ impl View for App { if self.habits.is_empty() { return EventResult::Ignored; } - self.set_view_month_offset(0); + self.reset_cursor(); self.habits[self.focus].on_event(e) } } -- cgit v1.2.3