Skip to main content

Module column_tree

Module column_tree 

Source
Expand description

A tree table with resizable, reorderable, hideable, sortable columns.

Callers supply columns, rows, and layout; ColumnTreeOut reports edits and actions for the caller to apply after drawing. Consumer-specific behavior stays in the panel. The first visible column uses crate::panels::tree::node.

Layout is mutated directly; callers persist it when layout_changed is set. ColumnLayout::frozen pins leading columns, so this widget owns horizontal scrolling. Expansion remains caller-owned. Transient drag, menu, and text-edit state lives in egui memory keyed by ColumnTreeSpec::id. Text edits commit on focus loss or Enter because applying a cell edit may rebuild geometry.

Row actions share one menu for cell clicks and right-clicks. Disabled entries remain visible with tooltips explaining why they are unavailable.

Structs§

CellClick
A CellKind::Button cell was clicked.
CellEdit
One cell was edited.
ColumnLayout
The user’s column arrangement — the widget WRITES this (header drag, divider drag, hide/show, sort click) and the consumer owns and persists it.
ColumnSpec
One column: its cell key, its heading, its editor, its default width.
ColumnTreeOut
What the user did in one drawn frame.
ColumnTreeSpec
Everything the consumer supplies. Borrowed; the widget holds no state of its own beyond egui memory.
RowAction
One entry in a row’s action menu: what to call it, whether this ROW allows it, and how to draw it. Everything here is the consumer’s vocabulary — the widget only ever compares RowAction::id for equality when it reports the click back.
RowActionClick
A row’s action menu fired.
RowNode
One row. Rows nest — this is a TREE, not a flat table — and each row’s cells are looked up by column key, so adding a column never touches the row builder’s shape.

Enums§

CellKind
What a column’s cells are, and therefore which editor the widget draws.

Constants§

DEFAULT_COLUMN_WIDTH
The default width of a column whose ColumnLayout carries none.
MIN_COLUMN_WIDTH
Minimum column width, in points — narrow enough to park a column out of the way, wide enough that its resize grip is still catchable.

Functions§

column_tree
Draw ONE complete column tree and return what the user did.
value_editor
Draw the editor for ONE value of a CellKind and report the committed edit, if any. salt seeds the per-widget egui ids (an in-progress text buffer, a combo’s open state), so it must be stable for a given value and distinct between values; size is the space to fill.