Skip to main content

Module chevron

Module chevron 

Source
Expand description

ChevronWidget — a small clickable arrow that toggles a collapsed/expanded state. Composes into title bars, accordion headers, tree rows, anywhere a “fold” affordance is needed.

The chevron is a real Widget: it has its own bounds, paints itself, and consumes mouse-down events that land inside it. The parent uses standard children_mut() + layout() to place it, and supplies an on_click closure to act on the toggle. Parents that need to share collapse state across multiple widgets pass an Rc<Cell<bool>> for the chevron to read each paint — keeping a single source of truth without copy-on-every-frame boilerplate.

Structs§

ChevronWidget
A clickable collapse / expand chevron.

Constants§

CHEVRON_SIZE
Logical size of the chevron’s hit / paint region. The arrow itself is ~8 px wide; the surrounding padding gives the user a comfortable click target.