Module focus

Module focus 

Source
Expand description

Module for focus-handling functionality. See rat-focus

Macros§

impl_has_focus
Create the implementation of HasFocus for the given list of struct members.
match_focus
Does a match on several fields and can return a result. Does a widget_state.is_focused() for each field and returns the first that is true. There is an else branch too.
on_gained
Does a match on the state struct of a widget. If widget_state.gained_focus() is true the block is executed. This requires that widget_state implements HasFocus, but that’s the basic requirement for this whole crate.
on_lost
Does a match on the state struct of a widget. If widget_state.lost_focus() is true the block is executed. This requires that widget_state implements HasFocus, but that’s the basic requirement for this whole crate.

Structs§

Focus
Focus deals with all focus-related issues.
FocusBuilder
Builder for the Focus.
FocusFlag
Holds the flags for the focus.

Enums§

Navigation
Focus navigation for widgets.

Traits§

HasFocus
Trait for a widget that takes part of focus handling.

Functions§

handle_focus
Handle all events.