pub struct FocusTraversalPolicy {
pub strategy: FocusTraversalStrategy,
pub wrap: bool,
pub tab_navigation: bool,
pub single_tab_stop: bool,
}Expand description
Policy applied by a focus scope or group when traversal starts inside it.
Use policies to describe how a container handles directional keys and
whether Tab navigation should stay inside the container.
Fields§
§strategy: FocusTraversalStrategyTraversal strategy used for arrow-key navigation.
wrap: boolWhether traversal wraps when it reaches either end of the group.
Whether Tab and Shift+Tab should be handled by this policy.
single_tab_stop: boolWhether the group contributes one stop to global Tab navigation. The preferred enabled descendant is used on entry; arrows still visit every traversable descendant.
Implementations§
Source§impl FocusTraversalPolicy
impl FocusTraversalPolicy
Sourcepub const fn new(strategy: FocusTraversalStrategy) -> Self
pub const fn new(strategy: FocusTraversalStrategy) -> Self
Creates a new traversal policy for the given strategy.
Sourcepub const fn horizontal() -> Self
pub const fn horizontal() -> Self
Creates a horizontal traversal policy.
Sourcepub const fn wrap(self, wrap: bool) -> Self
pub const fn wrap(self, wrap: bool) -> Self
Sets whether traversal wraps when it reaches either end.
Sets whether Tab and Shift+Tab should be handled inside this
policy owner.
Sourcepub const fn single_tab_stop(self, single_tab_stop: bool) -> Self
pub const fn single_tab_stop(self, single_tab_stop: bool) -> Self
Makes this group a single Tab stop, preferring a descendant marked with
FocusProperties::preferred_tab_stop and otherwise its first enabled
descendant. Tab leaves the group from any focused descendant.
Trait Implementations§
Source§impl Clone for FocusTraversalPolicy
impl Clone for FocusTraversalPolicy
Source§fn clone(&self) -> FocusTraversalPolicy
fn clone(&self) -> FocusTraversalPolicy
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for FocusTraversalPolicy
Source§impl Debug for FocusTraversalPolicy
impl Debug for FocusTraversalPolicy
impl Eq for FocusTraversalPolicy
Source§impl Hash for FocusTraversalPolicy
impl Hash for FocusTraversalPolicy
Source§impl PartialEq for FocusTraversalPolicy
impl PartialEq for FocusTraversalPolicy
impl StructuralPartialEq for FocusTraversalPolicy
Auto Trait Implementations§
impl Freeze for FocusTraversalPolicy
impl RefUnwindSafe for FocusTraversalPolicy
impl Send for FocusTraversalPolicy
impl Sync for FocusTraversalPolicy
impl Unpin for FocusTraversalPolicy
impl UnsafeUnpin for FocusTraversalPolicy
impl UnwindSafe for FocusTraversalPolicy
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§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>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn 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>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which 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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.