diff options
Diffstat (limited to 'src/habit/traits.rs')
-rw-r--r-- | src/habit/traits.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/habit/traits.rs b/src/habit/traits.rs index 54ec9e1..b17e5d2 100644 --- a/src/habit/traits.rs +++ b/src/habit/traits.rs @@ -1,6 +1,7 @@ use chrono::NaiveDate; use cursive::direction::Direction; use cursive::event::{Event, EventResult}; +use cursive::view::CannotFocus; use cursive::{Printer, Vec2}; use typetag; @@ -38,7 +39,7 @@ pub trait HabitWrapper: erased_serde::Serialize { fn on_event(&mut self, event: Event) -> EventResult; fn remaining(&self, date: NaiveDate) -> u32; fn required_size(&mut self, _: Vec2) -> Vec2; - fn take_focus(&mut self, _: Direction) -> bool; + fn take_focus(&mut self, _: Direction) -> Result<EventResult, CannotFocus>; fn inner_data_ref(&self) -> &InnerData; fn inner_data_mut_ref(&mut self) -> &mut InnerData; @@ -60,7 +61,7 @@ macro_rules! auto_habit_impl { fn required_size(&mut self, x: Vec2) -> Vec2 { ShadowView::required_size(self, x) } - fn take_focus(&mut self, d: Direction) -> bool { + fn take_focus(&mut self, d: Direction) -> Result<EventResult, CannotFocus> { ShadowView::take_focus(self, d) } |