pub struct Focusable {
pub id: WidgetId,
pub rect: Rect,
pub bounds: Rect,
pub form: Option<WidgetId>,
pub scroll: Option<WidgetId>,
pub skip: bool,
pub order: Option<f32>,
pub group: Option<WidgetId>,
pub autofocus: bool,
}Expand description
A focus stop: somewhere the keyboard can land, and what the traversal should make of it.
Fields§
§id: WidgetIdThe widget’s identity.
rect: RectIts visible box this frame: the box it was given, clipped by whatever encloses it. Empty when it is scrolled out of sight, which is what a click test wants — a tap on empty space must not land on something nobody can see.
bounds: RectIts box this frame, unclipped. What the geometry is really about: where the
widget is, whether or not any of it is on screen. Arrow navigation places
candidates by this, and Ui::reveal works out what to scroll from it.
form: Option<WidgetId>The crate::AutofillGroup this stop sits in — the form it is part of — when
there is one (milestone 512).
scroll: Option<WidgetId>The nearest enclosing scroll region, when there is one. What could bring this
stop into view, and the first link of the chain Ui::reveal walks.
skip: boolFocusable by a click, but passed over by Tab — the reference’s
ExcludeFocusTraversal. The two are separate questions.
order: Option<f32>An explicit traversal position, smallest first. None means tree order, which is
where everything sits until someone says otherwise.
group: Option<WidgetId>The traversal group it belongs to, within which its order is resolved.
autofocus: boolWhether it takes the focus when it appears (Widget::autofocus, milestone 605).