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<FocusInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<FocusInfo, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Serialize for FocusInfo
impl Serialize for FocusInfo
source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
. Box<dyn Any>
can
then be further downcast
into Box<ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
. Rc<Any>
can then be
further downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
source§impl<T> FsChangeNote for T
impl<T> FsChangeNote for T
§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> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§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