Skip to main content

render_tree

Function render_tree 

Source
pub fn render_tree(
    f: &mut Frame<'_>,
    area: Rect,
    title: &str,
    shortcut: Option<u8>,
    rows: &[TreeRow],
    state: &mut TreeState,
    focused: bool,
    theme: &Theme,
)
Expand description

Render a scrollable, focusable tree of rows inside area.

  • Uses focusable_block for the outer border + optional digit shortcut.
  • The selected row is highlighted with Theme::selection.
  • Branch rows show a ▾ (expanded) or ▸ (collapsed) glyph; leaves are indented to align with branch labels.
  • secondary text is right-aligned using Theme::hint.
  • Handles an empty rows slice without panicking.