Skip to main content

Module selector

Module selector 

Expand description

One painter for everything you choose one of: the window group’s tab strip, an in-app TabBar, the segments of a ToggleGroup and the top bar’s selectors (crates/sdk/ui-core/HIG.md §9.3).

A selector is a SelectionState resolved against the ground it stands on (selector_tier): idle paints nothing, hover is a translucent film of the active lift, and active is that lift opaque, with an edge and a lit rim. A docked strip of selectors stands on a body of its own (SelectorRole::Strip), made of the floating material, so tabs are never an unblurred translucent surface over the desktop. The theme’s crate::tokens::SelectorFinish says what the strip is made of and how strong the rim and the hover film are; high contrast, forced colours and reduced transparency make all of it opaque.

Enums§

SelectorRole
What of a selector is painted.

Functions§

paint_selector
Paint one selector: a strip body or an item, on shape.
selector_finish
The finish this theme paints selectors with: the theme’s own, or SelectorFinish::OPAQUE where nothing may be translucent.
selector_tier
How one selector on ground paints for state.
strip_ground
The ground a docked strip’s items stand on: the panel ground its material is tinted with, which is also the whole of it where nothing is blurred. On a light palette it stays one surface step below white, so the active tab can rise a full step toward the light above it.
strip_shape
The capsule a strip of selectors at rect is drawn as, concentric with items inset inset inside it at item_radius.