Skip to content

Commit

Permalink
Clear screen at initialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Thiel committed Jun 5, 2019
1 parent c33ae7c commit 37ce7fe
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/interactive/app/eventloop.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion tui-react/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tui-react"
version = "0.1.1"
version = "0.1.2"
authors = ["Sebastian Thiel <sthiel@thoughtworks.com>"]
edition = "2018"
repository = "https://github.com/Byron/dua-cli"
Expand Down
16 changes: 16 additions & 0 deletions tui-react/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

0 comments on commit 37ce7fe

Please sign in to comment.