diff --git a/src/interactive/app/eventloop.rs b/src/interactive/app/eventloop.rs index cf0fd8e7..cfe199f0 100644 --- a/src/interactive/app/eventloop.rs +++ b/src/interactive/app/eventloop.rs @@ -136,6 +136,7 @@ impl TerminalApp { B: Backend, { terminal.hide_cursor()?; + terminal.clear()?; let mut display_options: DisplayOptions = options.clone().into(); display_options.byte_vis = ByteVisualization::Bar; let mut window = ReactMainWindow::default(); diff --git a/tui-react/Cargo.toml b/tui-react/Cargo.toml index 4b2d6662..08c6ba64 100644 --- a/tui-react/Cargo.toml +++ b/tui-react/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "tui-react" -version = "0.1.1" +version = "0.1.2" authors = ["Sebastian Thiel "] edition = "2018" repository = "https://github.com/Byron/dua-cli" diff --git a/tui-react/src/lib.rs b/tui-react/src/lib.rs index e15b68ec..af8f6ac3 100644 --- a/tui-react/src/lib.rs +++ b/tui-react/src/lib.rs @@ -3,3 +3,19 @@ mod terminal; pub use list::*; pub use terminal::*; + +/// re-export our exact version, in case it matters to someone +pub use tui; + +use tui::buffer::Buffer; +use tui::layout::Rect; +use tui::style::Color; + +/// Helper method to quickly set the background of all cells inside the specified area. +pub fn fill_background(area: Rect, buf: &mut Buffer, color: Color) { + for y in area.top()..area.bottom() { + for x in area.left()..area.right() { + buf.get_mut(x, y).set_bg(color); + } + } +}