diff options
author | ClementTsang <cjhtsang@uwaterloo.ca> | 2021-09-24 23:19:08 -0400 |
---|---|---|
committer | ClementTsang <cjhtsang@uwaterloo.ca> | 2021-09-24 23:19:25 -0400 |
commit | abcca77c1ddcd465906549263b27dc41e769a30a (patch) | |
tree | c4b81cdfbdfe83f71024f940fc7a92f1d5740311 /src/app/widgets/base | |
parent | 7ee85a82f794c44b3a0bb6a50e8075eff96bb4c8 (diff) |
refactor: add process search conditions and error
Diffstat (limited to 'src/app/widgets/base')
-rw-r--r-- | src/app/widgets/base/text_input.rs | 21 | ||||
-rw-r--r-- | src/app/widgets/base/time_graph.rs | 2 |
2 files changed, 12 insertions, 11 deletions
diff --git a/src/app/widgets/base/text_input.rs b/src/app/widgets/base/text_input.rs index 47a5cb7b..1ca60910 100644 --- a/src/app/widgets/base/text_input.rs +++ b/src/app/widgets/base/text_input.rs @@ -297,7 +297,7 @@ impl Component for TextInput { } fn handle_key_event(&mut self, event: KeyEvent) -> ComponentEventResult { - if event.modifiers.is_empty() { + if event.modifiers.is_empty() || event.modifiers == KeyModifiers::SHIFT { match event.code { KeyCode::Left => { let original_cursor = self.cursor.cur_cursor(); @@ -356,16 +356,17 @@ impl Component for TextInput { } } - fn handle_mouse_event(&mut self, event: MouseEvent) -> ComponentEventResult { + fn handle_mouse_event(&mut self, _event: MouseEvent) -> ComponentEventResult { // We are assuming this is within bounds... - let x = event.column; - let widget_x = self.bounds.x + 2; - if x >= widget_x { - // TODO: Do this at some point after refactor - ComponentEventResult::Redraw - } else { - ComponentEventResult::NoRedraw - } + // let x = event.column; + // let widget_x = self.bounds.x + 2; + // if x >= widget_x { + // // TODO: Do this at some point after refactor + // ComponentEventResult::Redraw + // } else { + // ComponentEventResult::NoRedraw + // } + ComponentEventResult::Unhandled } } diff --git a/src/app/widgets/base/time_graph.rs b/src/app/widgets/base/time_graph.rs index 81ca9e15..47436f71 100644 --- a/src/app/widgets/base/time_graph.rs +++ b/src/app/widgets/base/time_graph.rs @@ -165,7 +165,7 @@ impl TimeGraph { '-' => self.zoom_out(), '+' => self.zoom_in(), '=' => self.reset_zoom(), - _ => ComponentEventResult::NoRedraw, + _ => ComponentEventResult::Unhandled, } } |