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/context | |
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/context')
-rw-r--r-- | src/context/context.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/context/context.rs b/src/context/context.rs index bb5a512..574b7af 100644 --- a/src/context/context.rs +++ b/src/context/context.rs @@ -6,7 +6,7 @@ use std::thread; use crate::config; use crate::context::{LocalStateContext, TabContext}; use crate::io::{IOWorkerObserver, IOWorkerProgress, IOWorkerThread}; -use crate::util::event::{Event, Events}; +use crate::util::event::{Events, JoshutoEvent}; pub struct JoshutoContext { pub exit: bool, @@ -61,10 +61,10 @@ impl JoshutoContext { } // event related - pub fn poll_event(&self) -> Result<Event, mpsc::RecvError> { + pub fn poll_event(&self) -> Result<JoshutoEvent, mpsc::RecvError> { self.events.next() } - pub fn get_event_tx(&self) -> mpsc::Sender<Event> { + pub fn get_event_tx(&self) -> mpsc::Sender<JoshutoEvent> { self.events.event_tx.clone() } pub fn flush_event(&self) { @@ -134,17 +134,17 @@ impl JoshutoContext { let worker_handle = thread::spawn(move || worker.start(wtx)); // relay worker info to event loop while let Ok(progress) = wrx.recv() { - let _ = tx.send(Event::IOWorkerProgress(progress)); + let _ = tx.send(JoshutoEvent::IOWorkerProgress(progress)); } let result = worker_handle.join(); match result { Ok(res) => { - let _ = tx.send(Event::IOWorkerResult(res)); + let _ = tx.send(JoshutoEvent::IOWorkerResult(res)); } Err(_) => { let err = std::io::Error::new(std::io::ErrorKind::Other, "Sending Error"); - let _ = tx.send(Event::IOWorkerResult(Err(err))); + let _ = tx.send(JoshutoEvent::IOWorkerResult(Err(err))); } } }); |