feat(Paragraph): add alignment convenience functions (#866)
Added convenience functions left_aligned(), centered() and right_aligned() plus unit tests. Updated example code. Signed-off-by: Eelco Empting <me@eelco.de>
This commit is contained in:
@@ -128,7 +128,7 @@ fn ui(f: &mut Frame, app: &App) {
|
||||
.title("Panic Handler Demo")
|
||||
.borders(Borders::ALL);
|
||||
|
||||
let p = Paragraph::new(text).block(b).alignment(Alignment::Center);
|
||||
let p = Paragraph::new(text).block(b).centered();
|
||||
|
||||
f.render_widget(p, f.size());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user