fix: info box lines

This commit is contained in:
Jack Wills
2022-04-29 03:14:35 +00:00
parent 3542f65e61
commit 1daf1c177d
+1 -3
View File
@@ -608,8 +608,6 @@ pub fn draw_info<B: Backend>(f: &mut Frame<'_, B>, text: String) {
.title_alignment(Alignment::Center) .title_alignment(Alignment::Center)
.borders(Borders::NONE); .borders(Borders::NONE);
// Add a blank line, so that the text is verticall centered
let text = format!("\n{}", text);
let mut max_line_width = 0; let mut max_line_width = 0;
text.lines().into_iter().for_each(|line| { text.lines().into_iter().for_each(|line| {
@@ -623,7 +621,7 @@ pub fn draw_info<B: Backend>(f: &mut Frame<'_, B>, text: String) {
// Add some horizontal & vertical margins // Add some horizontal & vertical margins
max_line_width += 8; max_line_width += 8;
lines += 3; lines += 2;
let paragraph = Paragraph::new(text) let paragraph = Paragraph::new(text)
.style(Style::default().bg(Color::Blue).fg(Color::White)) .style(Style::default().bg(Color::Blue).fg(Color::White))