mirror of
https://github.com/veeso/termscp.git
synced 2025-12-07 09:36:00 -08:00
Fixed msgbox wrap
This commit is contained in:
@@ -90,19 +90,17 @@ impl Component for MsgBox {
|
|||||||
Color::Reset => self.props.background,
|
Color::Reset => self.props.background,
|
||||||
_ => line.bg,
|
_ => line.bg,
|
||||||
};
|
};
|
||||||
let mut spans: Vec<Span> = Vec::new();
|
|
||||||
let message_row =
|
let message_row =
|
||||||
textwrap::wrap(line.content.as_str(), area.width as usize);
|
textwrap::wrap(line.content.as_str(), area.width as usize);
|
||||||
for msg in message_row.iter() {
|
for msg in message_row.iter() {
|
||||||
spans.push(Span::styled(
|
lines.push(ListItem::new(Spans::from(vec![Span::styled(
|
||||||
align_text_center(msg, area.width),
|
align_text_center(msg, area.width),
|
||||||
Style::default()
|
Style::default()
|
||||||
.add_modifier(line.get_modifiers())
|
.add_modifier(line.get_modifiers())
|
||||||
.fg(line_fg)
|
.fg(line_fg)
|
||||||
.bg(line_bg),
|
.bg(line_bg),
|
||||||
));
|
)])));
|
||||||
}
|
}
|
||||||
lines.push(ListItem::new(Spans::from(spans)));
|
|
||||||
}
|
}
|
||||||
lines
|
lines
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user