MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / draw_empty_message

Function draw_empty_message

crates/openshell-tui/src/ui/mod.rs:492–500  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

490/// `text` with the given `style`. Use this whenever a table or list has no
491/// rows to display.
492pub 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).

Callers 6

drawFunction · 0.85
draw_gateway_listFunction · 0.85
drawFunction · 0.85
drawFunction · 0.85
draw_v2Function · 0.85
drawFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected