add rounded corners and double borders to block example

This commit is contained in:
Matthew Stevenson 2019-12-15 13:50:18 -08:00 committed by Florian Dehau
parent 06d159fb7b
commit f1bc00b67f

View file

@ -32,7 +32,11 @@ fn main() -> Result<(), failure::Error> {
// Just draw the block and the group on the same area and build the group
// with at least a margin of 1
let size = f.size();
Block::default().borders(Borders::ALL).render(&mut f, size);
Block::default()
.borders(Borders::ALL)
.title("Main block with round corners")
.rounded()
.render(&mut f, size);
let chunks = Layout::default()
.direction(Direction::Vertical)
.margin(4)
@ -68,9 +72,10 @@ fn main() -> Result<(), failure::Error> {
.borders(Borders::ALL)
.render(&mut f, chunks[0]);
Block::default()
.title("With styled borders")
.title("With styled and double borders")
.border_style(Style::default().fg(Color::Cyan))
.borders(Borders::LEFT | Borders::RIGHT)
.double_border()
.render(&mut f, chunks[1]);
}
})?;