Skip to main content

Module focus_visible

Module focus_visible 

Expand description

Focus-visible: the focus ring shows for keyboard focus only (docs/design-language.md, “Colour roles”).

A click or tap that focuses a control must never ring it; a Tab, an arrow or any other key brings the ring back. Hosts note every input event with note before dispatching it, and every painter of a focus ring asks shown (the shared crate::widget::paint_focus_ring does it for its callers). Controls that track their own pressed-into-focus state (Button, BoolControl, ToggleGroup) keep doing so; this is the one rule for everything else.

Functions§

note
Note event: a key press makes focus visible, a pointer press or a touch hides it. Everything else leaves the modality alone.
shown
Whether a focus ring should show now: the last focusing input was the keyboard (or there has been none yet).