Render a bordered confirmation popup centred on `area`. `lines` is the popup body; height is derived from the line count. Use `t.border_focused` for confirmations and `t.status_err` for destructive actions.
(
frame: &mut Frame<'_>,
lines: Vec<Line<'_>>,
border_style: Style,
width: u16,
area: Rect,
)
| 639 | /// Use `t.border_focused` for confirmations and `t.status_err` for destructive |
| 640 | /// actions. |
| 641 | fn draw_confirm_popup( |
| 642 | frame: &mut Frame<'_>, |
| 643 | lines: Vec<Line<'_>>, |
| 644 | border_style: Style, |
| 645 | width: u16, |
| 646 | area: Rect, |
| 647 | ) { |
| 648 | let popup_height = u16::try_from(lines.len() + 2).unwrap_or(u16::MAX); |
| 649 | let popup = centered_popup(width, popup_height, area); |
| 650 | frame.render_widget(Clear, popup); |
| 651 | |
| 652 | let block = Block::default() |
| 653 | .borders(Borders::ALL) |
| 654 | .border_style(border_style) |
| 655 | .padding(Padding::horizontal(1)); |
| 656 | |
| 657 | frame.render_widget(Paragraph::new(lines).block(block), popup); |
| 658 | } |
| 659 | |
| 660 | /// Center a popup rectangle within `area` using percentage-based width and |
| 661 | /// an absolute height (in rows). |
no test coverage detected