add rounded corners and double borders to block example

pull/224/head
Matthew Stevenson 5 years ago committed by Florian Dehau
parent 06d159fb7b
commit f1bc00b67f

@ -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]);
}
})?;

Loading…
Cancel
Save