pub struct FocusProperties {
pub can_focus: bool,
pub can_request_focus: bool,
pub skip_traversal: bool,
pub next: Option<FocusRequester>,
pub previous: Option<FocusRequester>,
pub up: Option<FocusRequester>,
pub down: Option<FocusRequester>,
pub left: Option<FocusRequester>,
pub right: Option<FocusRequester>,
pub enter: Option<FocusRequester>,
pub exit: Option<FocusRequester>,
}Expand description
Focus properties used when registering a focus node on the current component.
Use properties to enable or disable focus participation and to declare explicit traversal neighbors for complex layouts.
§Examples
use tessera_ui::{FocusProperties, FocusRequester};
let next = FocusRequester::new();
let right = FocusRequester::new();
let props = FocusProperties::new()
.can_focus(true)
.skip_traversal(false)
.next(next)
.right(right);
assert_eq!(props.next, Some(next));
assert_eq!(props.right, Some(right));
assert!(props.can_focus);
assert!(!props.skip_traversal);Fields§
§can_focus: boolWhether this node may receive focus.
can_request_focus: boolWhether this node may be the target of focus requests.
skip_traversal: boolWhether traversal should skip this node.
next: Option<FocusRequester>Explicit target for Next traversal.
previous: Option<FocusRequester>Explicit target for Previous traversal.
up: Option<FocusRequester>Explicit target for Up traversal.
down: Option<FocusRequester>Explicit target for Down traversal.
left: Option<FocusRequester>Explicit target for Left traversal.
right: Option<FocusRequester>Explicit target for Right traversal.
enter: Option<FocusRequester>Explicit target when entering a nested focus region.
exit: Option<FocusRequester>Explicit target when exiting a focus region.
Implementations§
Source§impl FocusProperties
impl FocusProperties
Sourcepub fn can_request_focus(self, can_request_focus: bool) -> Self
pub fn can_request_focus(self, can_request_focus: bool) -> Self
Sets whether this node may be the target of focus requests.
Sourcepub fn skip_traversal(self, skip_traversal: bool) -> Self
pub fn skip_traversal(self, skip_traversal: bool) -> Self
Sets whether traversal should skip this node.
Sourcepub fn next(self, requester: FocusRequester) -> Self
pub fn next(self, requester: FocusRequester) -> Self
Sets the explicit requester for Next traversal.
Sourcepub fn previous(self, requester: FocusRequester) -> Self
pub fn previous(self, requester: FocusRequester) -> Self
Sets the explicit requester for Previous traversal.
Sourcepub fn up(self, requester: FocusRequester) -> Self
pub fn up(self, requester: FocusRequester) -> Self
Sets the explicit requester for Up traversal.
Sourcepub fn down(self, requester: FocusRequester) -> Self
pub fn down(self, requester: FocusRequester) -> Self
Sets the explicit requester for Down traversal.
Sourcepub fn left(self, requester: FocusRequester) -> Self
pub fn left(self, requester: FocusRequester) -> Self
Sets the explicit requester for Left traversal.
Sourcepub fn right(self, requester: FocusRequester) -> Self
pub fn right(self, requester: FocusRequester) -> Self
Sets the explicit requester for Right traversal.
Sourcepub fn enter(self, requester: FocusRequester) -> Self
pub fn enter(self, requester: FocusRequester) -> Self
Sets the explicit requester used when moving focus into a group.
Sourcepub fn exit(self, requester: FocusRequester) -> Self
pub fn exit(self, requester: FocusRequester) -> Self
Sets the explicit requester used when moving focus out of a group.
Trait Implementations§
Source§impl Clone for FocusProperties
impl Clone for FocusProperties
Source§fn clone(&self) -> FocusProperties
fn clone(&self) -> FocusProperties
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for FocusProperties
impl Debug for FocusProperties
Source§impl Default for FocusProperties
impl Default for FocusProperties
Source§impl PartialEq for FocusProperties
impl PartialEq for FocusProperties
impl Copy for FocusProperties
impl Eq for FocusProperties
impl StructuralPartialEq for FocusProperties
Auto Trait Implementations§
impl Freeze for FocusProperties
impl RefUnwindSafe for FocusProperties
impl Send for FocusProperties
impl Sync for FocusProperties
impl Unpin for FocusProperties
impl UnwindSafe for FocusProperties
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
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.§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
§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
§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>
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>
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