diff options
author | Joris | 2023-01-26 08:12:13 +0100 |
---|---|---|
committer | Joris | 2023-01-26 08:40:13 +0100 |
commit | 417d0cac77ff4e48945bbc3086dd6d5c0c3bda6e (patch) | |
tree | b5ff138092623733c1541f79877cd0b5b8f96d73 /src/gui/message.rs | |
parent | 155d8d96574a5ba141767da1af57afde55fccf6f (diff) |
Upgrade dependencies
- Switch to crossterm
- add --hide-progress option
Diffstat (limited to 'src/gui/message.rs')
-rw-r--r-- | src/gui/message.rs | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/src/gui/message.rs b/src/gui/message.rs index 29b5d8a..0136f1c 100644 --- a/src/gui/message.rs +++ b/src/gui/message.rs @@ -1,7 +1,6 @@ use crate::gui::util; -use crate::util::event::{Event, Events}; +use crossterm::event::{self, Event, KeyCode, KeyModifiers}; use anyhow::Result; -use termion::event::Key; use tui::{ backend::Backend, layout::{Alignment, Constraint, Direction, Layout}, @@ -11,7 +10,6 @@ use tui::{ pub fn show<B: Backend>( terminal: &mut Terminal<B>, - events: &Events, title: &str, message: &str, wait: bool, @@ -33,14 +31,13 @@ pub fn show<B: Backend>( })?; if wait { - if let Event::Input(key) = events.next()? { - match key { - Key::Char('q') | Key::Ctrl('c') => { - break; - } - _ => {} + // if crossterm::event::poll(Duration::from_secs(0))? { + if let Event::Key(key) = event::read()? { + if key.code == KeyCode::Char('q') || key.code == KeyCode::Char('c') && key.modifiers.contains(KeyModifiers::CONTROL) { + break; } } + // } } else { break; } |