mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-22 20:53:19 +00:00
add rounded corners and double borders to block example
This commit is contained in:
parent
06d159fb7b
commit
f1bc00b67f
1 changed files with 7 additions and 2 deletions
|
@ -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…
Reference in a new issue