summaryrefslogtreecommitdiffstats
path: root/src/context.rs
diff options
context:
space:
mode:
authorJiayi Zhao <jeff.no.zhao@gmail.com>2020-02-22 19:54:41 -0500
committerJiayi Zhao <jeff.no.zhao@gmail.com>2020-02-22 19:54:41 -0500
commitd38dcdbbee44187bdb605dbf9bbf9c6c6d3e4f35 (patch)
tree91b059b99793fe250c67f66be3930a298117e0b3 /src/context.rs
parent03594099dafb4cda04e50f087df61cf76e2034d0 (diff)
implement textfield widget
- for asking users for long input strings - implement prompt widget - for prompting users for a single key response
Diffstat (limited to 'src/context.rs')
-rw-r--r--src/context.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/context.rs b/src/context.rs
index c0651d9..328f9f6 100644
--- a/src/context.rs
+++ b/src/context.rs
@@ -6,7 +6,7 @@ use crate::io::IOWorkerThread;
use crate::tab::JoshutoTab;
use crate::util::event::Events;
-pub const MESSAGE_VISIBLE_DURATION: usize = 2;
+pub const MESSAGE_VISIBLE_DURATION: usize = 1;
pub struct JoshutoContext {
pub exit: bool,
@@ -15,6 +15,7 @@ pub struct JoshutoContext {
pub worker_queue: VecDeque<IOWorkerThread>,
pub trx: (mpsc::SyncSender<u64>, mpsc::Receiver<u64>),
+ pub worker_msg: Option<String>,
pub message_queue: VecDeque<String>,
pub message_elapse: usize,
pub events: Events,
@@ -30,8 +31,9 @@ impl JoshutoContext {
tabs: Vec::new(),
worker_queue: VecDeque::with_capacity(10),
trx: mpsc::sync_channel::<u64>(1),
+ worker_msg: None,
message_queue: VecDeque::with_capacity(4),
- message_elapse: MESSAGE_VISIBLE_DURATION,
+ message_elapse: 0,
events: Events::new(),
config_t,