pub enum FocusInfo {
NotFocusable,
Focusable {
tab_index: TabIndex,
skip_directional: bool,
},
FocusScope {
tab_index: TabIndex,
skip_directional: bool,
tab_nav: TabNav,
directional_nav: DirectionalNav,
on_focus: FocusScopeOnFocus,
alt: bool,
},
}Expand description
Focus metadata associated with a widget info tree.
Variants§
NotFocusable
The widget is not focusable.
Focusable
The widget is focusable as a single item.
Fields
FocusScope
The widget is a focusable focus scope.
Fields
Tab navigation inside the focus scope.
Directional navigation inside the focus scope.
§
on_focus: FocusScopeOnFocusBehavior of the widget when receiving direct focus.
Implementations§
Source§impl FocusInfo
impl FocusInfo
Sourcepub fn is_focusable(self) -> bool
pub fn is_focusable(self) -> bool
If is focusable or a focus scope.
Sourcepub fn is_alt_scope(self) -> bool
pub fn is_alt_scope(self) -> bool
If is an ALT focus scope.
Tab navigation mode.
| Variant | Returns |
|---|---|
| Focus scope | Associated value, default is Continue |
| Focusable | TabNav::Continue |
| Not-Focusable | TabNav::None |
Directional navigation mode.
| Variant | Returns |
|---|---|
| Focus scope | Associated value, default is None |
| Focusable | DirectionalNav::Continue |
| Not-Focusable | DirectionalNav::None |
Sourcepub fn tab_index(self) -> TabIndex
pub fn tab_index(self) -> TabIndex
Tab navigation index.
| Variant | Returns |
|---|---|
| Focusable & Scope | Associated value, default is TabIndex::AUTO |
| Not-Focusable | TabIndex::SKIP |
Sourcepub fn skip_directional(self) -> bool
pub fn skip_directional(self) -> bool
If directional navigation skips over this widget.
| Variant | Returns |
|---|---|
| Focusable & Scope | Associated value, default is false |
| Not-Focusable | true |
Sourcepub fn scope_on_focus(self) -> FocusScopeOnFocus
pub fn scope_on_focus(self) -> FocusScopeOnFocus
Focus scope behavior when it receives direct focus.
| Variant | Returns |
|---|---|
| Scope | Associated value, default is FocusScopeOnFocus::FirstDescendant |
| Focusable & Not-Focusable | FocusScopeOnFocus::Self_ |
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FocusInfo
impl<'de> Deserialize<'de> for FocusInfo
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Copy for FocusInfo
Auto Trait Implementations§
impl Freeze for FocusInfo
impl RefUnwindSafe for FocusInfo
impl Send for FocusInfo
impl Sync for FocusInfo
impl Unpin for FocusInfo
impl UnwindSafe for FocusInfo
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more