Render an empty-state message inside a bordered panel. Calculates an inset [`Rect`] that clears the panel border and renders `text` with the given `style`. Use this whenever a table or list has no rows to display.
(frame: &mut Frame<'_>, area: Rect, text: &str, style: Style)
| 490 | /// `text` with the given `style`. Use this whenever a table or list has no |
| 491 | /// rows to display. |
| 492 | pub fn draw_empty_message(frame: &mut Frame<'_>, area: Rect, text: &str, style: Style) { |
| 493 | let inner = Rect { |
| 494 | x: area.x + 2, |
| 495 | y: area.y + 2, |
| 496 | width: area.width.saturating_sub(4), |
| 497 | height: area.height.saturating_sub(3), |
| 498 | }; |
| 499 | frame.render_widget(Paragraph::new(Span::styled(text, style)), inner); |
| 500 | } |
| 501 | |
| 502 | /// Center a popup rectangle within `area` using absolute width and height (in |
| 503 | /// terminal columns/rows). |