regular refresh
This commit is contained in:
parent
430c62c120
commit
e490a2ce04
1 changed files with 8 additions and 2 deletions
|
|
@ -13,6 +13,7 @@ use std::{
|
|||
path::{Path, PathBuf},
|
||||
process::exit,
|
||||
sync::Arc,
|
||||
time::Duration,
|
||||
};
|
||||
use tui_widget_list::{ListBuilder, ListView};
|
||||
|
||||
|
|
@ -408,6 +409,11 @@ impl App {
|
|||
|
||||
terminal.draw(|frame| frame.render_widget(&mut self, frame.area()))?;
|
||||
|
||||
// update every 250ms or more if there's an event
|
||||
if !event::poll(Duration::from_millis(250))? {
|
||||
continue;
|
||||
}
|
||||
|
||||
match event::read()? {
|
||||
Event::Key(key) => {
|
||||
// to initialize, but we then do get manually for borrow reasons
|
||||
|
|
@ -507,9 +513,9 @@ impl App {
|
|||
let block = Block::bordered()
|
||||
.style(styles.default)
|
||||
.border_style(if selected {
|
||||
styles.border
|
||||
} else {
|
||||
styles.border_highlighted
|
||||
} else {
|
||||
styles.border
|
||||
});
|
||||
let inner = block.inner(area);
|
||||
block.render(area, buf);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue