Skip to main content

Module spinner

Module spinner 

Source
Expand description

Spinner — a shader-driven circular-arc loading indicator.

Uses the same per-slot uniform-buffer pipeline as ProgressBar::indeterminate (an [AnimatedQuadKind] variant), so per-frame cost is one queue.write_buffer(64 B) + draw_indexed — the widget’s paint() does not re-run between frames and there’s no signal-dirty-mark cascade.

let _s = Spinner::new(24.0)
    .color(TextRole::Secondary)
    .label(lit!("Loading"));

Defaults match the typical CSS spinner: a quarter-circle (90°) arc rotating clockwise from the top, completing one full rotation every 900 ms.

Honours prefers-reduced-motion: registers no animated quad and falls back to a static three-quarter arc — the indicator is still visible (so the user can tell the surface is busy) but doesn’t rotate.

Structs§

Spinner
A circular-arc loading indicator driven by a GPU shader quad.