One more clean up fix

This commit is contained in:
Wojciech Kozlowski 2023-04-12 10:25:24 +02:00
parent 9e7d2edc0d
commit 47aa6d2e96

View File

@ -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<B: Backend>(
@ -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,
);
}