Skip to main content

Module tree_view

Module tree_view 

Expand description

TreeView — hierarchical list. One row per visible node, indented by depth; branch nodes carry an expand/collapse glyph. Selection and focus are tracked separately so arrow-key navigation can move the focus ring without committing a selection until the user explicitly chooses.

Expand/select/focus state lives on the widget; on_select is how the caller persists a choice into its own (e.g. CRDT-backed) storage.

Structs§

TreeHeadingAction
An icon button at the trailing edge of the heading band (a sidebar’s “new item”).
TreeLoadRequest
TreeNode
TreeRowAction
A compact action shown at the trailing edge of the hovered row (a “new child” plus, a “more” ellipsis). Assistive technology sees every row’s actions as buttons named "{accessible_name} {row label}".
TreeRowDecoration
Per-row presentation painted by the tree itself: a leading icon, a label tone, trailing secondary text (a count, a type) and an accessible description. Unlike TreeView::with_row_delegate nothing is mounted, so decorations are recomputed every frame at no retained cost; disclosure, selection, hover, the current row, focus and semantics stay owned by the tree.
TreeRowInfo
What a TreeView::with_row_decoration callback is told about the row it decorates.
TreeSlot
Stable address of one logical child slot in a paged model. Slots remain present while their data transitions from loading to ready or error.
TreeView

Enums§

TreeChildState
State returned for a logical child slot. A model can publish its total child count before all child ids are resident, allowing the tree to retain correct scrollbar geometry while requesting only visible pages.
TreeClickActivation
How a pointer press activates a row (see TreeView::on_activate). Keyboard Enter and the accessibility Activate verb activate the focused row in either mode.
TreeLoadReason
TreeModelChange
A granular notification from an external tree model. Structural and slot identity changes reconcile the expanded-order index once per batch; label changes preserve geometry and query fresh data on the next frame.
TreeMove
A structural move of one row — what a drag does, as a single step for the keyboard (Alt + arrows, or Tab / Shift+Tab with TreeView::tab_indents) and for assistive technology, which sees one button per move on every row.
TreeRowIcon
A leading glyph for a decorated row. Colours are resolved by the caller from the Theme handed to the decoration callback, so they track the active theme.
TreeRowKey
Stable identity of either a resident model node or an unresolved child slot. Selection remains node-only, while focus and viewport anchoring can safely include placeholders.
TreeRowTone
The label colour role of a decorated row.
TreeSlotState
Non-resident row state passed to TreeView::with_slot_delegate.

Traits§

TreeModel
Source-agnostic hierarchy queried by stable id. Implementations may be backed by a database, an async cache, a CRDT, or the owned TreeNode adapter. The view asks only for expanded children and visible labels. IDs must be unique, parent/child queries must be inverse, and the reachable hierarchy must be acyclic.

Type Aliases§

NodeId