GPUI Box GitHub

Components

TreeGrid builder

A product-neutral, caller-owned virtualized treegrid adapter.

A builder is RenderOnce. Construct and mount it in one expression.

use gpui_kit::data::TreeGrid;

Construct

new(ident: impl Into<Ident>, visible_row_count: usize, render_row: impl Fn(usize, &mut Window, &mut App) -> TreeGridRow + 'static) -> Self

Options

Chain onto the value.

column(column: GridColumn) -> Self
columns(columns: impl IntoIterator<Item = GridColumn>) -> Self
selected(id: impl Into<SharedString>) -> Self
visible_rows(rows: usize) -> Self
row_height(height: f32) -> Self
lines(lines: GridLines) -> Self
loading(loading: bool) -> Self
failure(detail: impl Into<SharedString>) -> Self
empty(state: EmptyState) -> Self
unavailable(title: impl Into<SharedString>) -> Self
on_select(handler: impl Fn(SharedString, &mut Window, &mut App) + 'static) -> Self
on_expand(handler: impl Fn(SharedString, bool, &mut Window, &mut App) + 'static) -> Self

Rendered by

Each of these compiles and is captured by the gate, so the code behind them is verified rather than written.

Source: crates/gpui-kit/src/data/tree_grid.rs