diff options
author | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-12-30 14:02:10 -0500 |
---|---|---|
committer | Jiayi Zhao <jeff.no.zhao@gmail.com> | 2020-12-30 14:02:10 -0500 |
commit | e4faa16c8a7f2a51303ad3fe9f3891d8f7eabb82 (patch) | |
tree | 3d1be976d3a23d2aad667b1106668263cfd5ce6d /src/ui/views | |
parent | 72f5e1eaf4c0fcbe39bd3f0d80cf9ab45d504057 (diff) |
add resize notification support and preliminary mouse support
- currently scroll is hardmapped to cursor_up and cursor_down
Diffstat (limited to 'src/ui/views')
-rw-r--r-- | src/ui/views/tui_worker_view.rs | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/ui/views/tui_worker_view.rs b/src/ui/views/tui_worker_view.rs index 536c45a..58eaef2 100644 --- a/src/ui/views/tui_worker_view.rs +++ b/src/ui/views/tui_worker_view.rs @@ -1,12 +1,12 @@ -use termion::event::Key; +use termion::event::{Event, Key}; use tui::layout::Rect; use crate::context::JoshutoContext; use crate::ui::widgets::TuiWorker; use crate::ui::TuiBackend; -use crate::util::event::Event; -use crate::util::worker; +use crate::util::event::JoshutoEvent; +use crate::util::input_process; pub struct TuiWorkerView {} @@ -33,21 +33,16 @@ impl TuiWorkerView { if let Ok(event) = context.poll_event() { match event { - Event::IOWorkerProgress(res) => { - worker::process_worker_progress(context, res); - } - Event::IOWorkerResult(res) => { - worker::process_finished_worker(context, res); - } - Event::Input(key) => { - match key { - Key::Esc => { + JoshutoEvent::Termion(event) => { + match event { + Event::Key(Key::Esc) => { break; } _ => {} } context.flush_event(); } + event => input_process::process_noninteractive(event, context), }; } } |