Skip to main content

Module operation

Module operation 

Source
Expand description

Change internal widget state.

Structs§

AbsoluteOffset
The amount of absolute offset in each direction of a Scrollable.
EnsureVisibleConfig
Configuration for [ensure_focused_visible].
RelativeOffset
The amount of relative offset in each direction of a Scrollable.
ScrollAnimation
Configuration for animated scrolling.

Enums§

FocusDirection
Spatial direction for directional focus navigation.

Functions§

ensure_focused_visible
Scrolls the nearest scrollable ancestor of the currently focused widget so the focused widget is visible at the configured alignment.
focus
Focuses the widget with the given Id.
focus_auto
Focuses the first widget marked for auto-focus.
focus_direction
Focuses the nearest focusable widget in the given spatial FocusDirection.
focus_direction_no_wrap
Like focus_direction, but does not wrap to the opposite edge when no candidate exists in the requested direction. Focus simply stays on the currently focused widget.
focus_next
Focuses the next focusable widget.
focus_previous
Focuses the previous focusable widget.
is_focused
Returns whether the widget with the given Id is focused or not.
move_cursor_to
Moves the cursor of the widget with the given Id to the provided position.
move_cursor_to_end
Moves the cursor of the widget with the given Id to the end.
move_cursor_to_front
Moves the cursor of the widget with the given Id to the front.
press_focused
Activates the currently focused widget by calling its Focusable::press() method.
scroll_by
Scrolls the scrollable with the given Id by the provided AbsoluteOffset.
scroll_to
Scrolls the scrollable with the given Id to the provided AbsoluteOffset.
select_all
Selects all the content of the widget with the given Id.
select_range
Selects the given content range of the widget with the given Id.
snap_to
Snaps the scrollable with the given Id to the provided RelativeOffset.
snap_to_end
Snaps the scrollable with the given Id to the RelativeOffset::END.
unfocus
Unfocuses the currently focused widget.