aboutsummaryrefslogtreecommitdiff
path: root/src/app/impl_view.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/app/impl_view.rs')
-rw-r--r--src/app/impl_view.rs10
1 files changed, 5 insertions, 5 deletions
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 {
117 if self.habits.is_empty() { 117 if self.habits.is_empty() {
118 return EventResult::Consumed(None); 118 return EventResult::Consumed(None);
119 } 119 }
120 if self.habits[self.focus].view_mode() == ViewMode::Week { 120 if self.habits[self.focus].inner_data_ref().view_mode() == ViewMode::Week {
121 self.set_mode(ViewMode::Day) 121 self.set_mode(ViewMode::Day)
122 } else { 122 } else {
123 self.set_mode(ViewMode::Week) 123 self.set_mode(ViewMode::Week)
@@ -126,13 +126,13 @@ impl View for App {
126 } 126 }
127 Event::Char('V') => { 127 Event::Char('V') => {
128 for habit in self.habits.iter_mut() { 128 for habit in self.habits.iter_mut() {
129 habit.set_view_mode(ViewMode::Week); 129 habit.inner_data_mut_ref().set_view_mode(ViewMode::Week);
130 } 130 }
131 return EventResult::Consumed(None); 131 return EventResult::Consumed(None);
132 } 132 }
133 Event::Key(Key::Esc) => { 133 Event::Key(Key::Esc) => {
134 for habit in self.habits.iter_mut() { 134 for habit in self.habits.iter_mut() {
135 habit.set_view_mode(ViewMode::Day); 135 habit.inner_data_mut_ref().set_view_mode(ViewMode::Day);
136 } 136 }
137 return EventResult::Consumed(None); 137 return EventResult::Consumed(None);
138 } 138 }
@@ -149,7 +149,7 @@ impl View for App {
149 return EventResult::Consumed(None); 149 return EventResult::Consumed(None);
150 } 150 }
151 Event::Char('}') => { 151 Event::Char('}') => {
152 self.set_view_month_offset(0); 152 self.reset_cursor();
153 return EventResult::Consumed(None); 153 return EventResult::Consumed(None);
154 } 154 }
155 Event::CtrlChar('l') => { 155 Event::CtrlChar('l') => {
@@ -166,7 +166,7 @@ impl View for App {
166 if self.habits.is_empty() { 166 if self.habits.is_empty() {
167 return EventResult::Ignored; 167 return EventResult::Ignored;
168 } 168 }
169 self.set_view_month_offset(0); 169 self.reset_cursor();
170 self.habits[self.focus].on_event(e) 170 self.habits[self.focus].on_event(e)
171 } 171 }
172 } 172 }