diff --git a/src/tui/ui.rs b/src/tui/ui.rs index 997b473..0600687 100644 --- a/src/tui/ui.rs +++ b/src/tui/ui.rs @@ -242,11 +242,12 @@ impl Ui { }) } - fn block<'a>() -> Block<'a> { + fn block<'a>(title: &str) -> Block<'a> { Block::default() .title_alignment(Alignment::Center) .borders(Borders::ALL) .border_type(BorderType::Rounded) + .title(format!(" {title} ")) } fn render_list_widget( @@ -260,7 +261,7 @@ impl Ui { .highlight_style(Self::highlight_style(list.active)) .highlight_symbol(">> ") .style(Self::style()) - .block(Self::block().title(format!(" {title} "))), + .block(Self::block(title)), area, &mut list.state, ); @@ -273,9 +274,7 @@ impl Ui { frame: &mut Frame<'_, B>, ) { frame.render_widget( - paragraph - .style(Self::style()) - .block(Self::block().title(format!(" {title} "))), + paragraph.style(Self::style()).block(Self::block(title)), area, ); }