Skip to content

Commit

Permalink
Upgrade to tui 0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Thiel committed May 4, 2020
1 parent a078086 commit 42c541a
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 32 deletions.
20 changes: 5 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ jwalk = "0.5.0"
byte-unit = "3"
termion = "1.5.2"
atty = "0.2.11"
tui = "0.8.0"
tui = "0.9.1"
petgraph = "0.5"
itertools = "0.9.0"
open = "1.2.2"
log = "0.4.6"
tui-react = { path = "./tui-react", version = "0.3" }
tui-react = { path = "./tui-react", version = "0.4" }
num_cpus = "1.10.0"
unicode-segmentation = "1.3.0"
filesize = "0.2.0"
Expand Down
6 changes: 3 additions & 3 deletions src/interactive/widgets/footer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ use tui::{
layout::Rect,
style::Modifier,
style::{Color, Style},
widgets::Widget,
widgets::{Paragraph, Text},
widgets::{Paragraph, Text, Widget},
};

pub struct Footer;

pub struct FooterProps {
Expand Down Expand Up @@ -55,6 +55,6 @@ impl Footer {
modifier: Modifier::REVERSED,
..Default::default()
})
.draw(area, buf);
.render(area, buf);
}
}
2 changes: 1 addition & 1 deletion src/interactive/widgets/header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@ impl Header {
bg: bg_color,
..Default::default()
})
.draw(area, buf);
.render(area, buf);
}
}
6 changes: 3 additions & 3 deletions src/interactive/widgets/help.rs
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,11 @@ impl HelpPane {
} = props.borrow();

let title = "Help";
let mut block = Block::default()
let block = Block::default()
.title(title)
.border_style(*border_style)
.borders(Borders::ALL);
block.draw(area, buf);
block.render(area, buf);

if *has_focus {
let help_text = " . = o|.. = u || ⇊ = CTRL+d|↓ = j|⇈ = CTRL+u|↑ = k ";
Expand All @@ -221,6 +221,6 @@ impl HelpPane {
self.scroll = self.scroll.min(num_lines.saturating_sub(area.height));
Paragraph::new(texts.iter())
.scroll(self.scroll)
.draw(area, buf);
.render(area, buf);
}
}
6 changes: 3 additions & 3 deletions src/interactive/widgets/mark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,13 @@ impl MarkPane {
Some(marked.len().saturating_sub(1))
}
};
let mut block = Block::default()
let block = Block::default()
.title(&title)
.border_style(*border_style)
.borders(Borders::ALL);

let inner_area = block.inner(area);
block.draw(area, buf);
block.render(area, buf);

let list_area = if self.has_focus {
let (help_line_area, list_area) = {
Expand Down Expand Up @@ -370,7 +370,7 @@ impl MarkPane {
.iter(),
)
.style(default_style)
.draw(help_line_area, buf);
.render(help_line_area, buf);
list_area
} else {
inner_area
Expand Down
4 changes: 2 additions & 2 deletions tui-react/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tui-react"
version = "0.3.0"
version = "0.4.0"
authors = ["Sebastian Thiel <sthiel@thoughtworks.com>"]
edition = "2018"
repository = "https://github.com/Byron/dua-cli"
Expand All @@ -9,7 +9,7 @@ readme = "README.md"
license = "MIT"

[dependencies]
tui = { version = "0.8.0", default-features = false }
tui = { version = "0.9.1", default-features = false }
log = "0.4.6"
unicode-segmentation = "1.6.0"
unicode-width = "0.1.7"
6 changes: 3 additions & 3 deletions tui-react/src/list.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ impl List {
} = props;

let list_area = match block {
Some(mut b) => {
b.draw(area, buf);
Some(b) => {
b.render(area, buf);
b.inner(area)
}
None => area,
Expand All @@ -62,7 +62,7 @@ impl List {
.take(list_area.height as usize)
{
let (x, y) = (list_area.left(), list_area.top() + i as u16);
Paragraph::new(text_iterator.iter()).draw(
Paragraph::new(text_iterator.iter()).render(
Rect {
x,
y,
Expand Down

0 comments on commit 42c541a

Please sign in to comment.