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: FocusScopeOnFocus
Behavior 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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)§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