mirror of
https://github.com/ratatui/ratatui.git
synced 2025-09-30 22:41:44 +00:00
add rounded corners and double borders to block example
This commit is contained in:
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
|
// Just draw the block and the group on the same area and build the group
|
||||||
// with at least a margin of 1
|
// with at least a margin of 1
|
||||||
let size = f.size();
|
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()
|
let chunks = Layout::default()
|
||||||
.direction(Direction::Vertical)
|
.direction(Direction::Vertical)
|
||||||
.margin(4)
|
.margin(4)
|
||||||
@ -68,9 +72,10 @@ fn main() -> Result<(), failure::Error> {
|
|||||||
.borders(Borders::ALL)
|
.borders(Borders::ALL)
|
||||||
.render(&mut f, chunks[0]);
|
.render(&mut f, chunks[0]);
|
||||||
Block::default()
|
Block::default()
|
||||||
.title("With styled borders")
|
.title("With styled and double borders")
|
||||||
.border_style(Style::default().fg(Color::Cyan))
|
.border_style(Style::default().fg(Color::Cyan))
|
||||||
.borders(Borders::LEFT | Borders::RIGHT)
|
.borders(Borders::LEFT | Borders::RIGHT)
|
||||||
|
.double_border()
|
||||||
.render(&mut f, chunks[1]);
|
.render(&mut f, chunks[1]);
|
||||||
}
|
}
|
||||||
})?;
|
})?;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user