pub enum UnfocusDisposition {
Scope,
PreviouslyFocusedChild,
}Expand description
Describe what should happen after AnyFocusNode::unfocus is called.
Variants§
Scope
Focus the nearest focusable enclosing scope of this node, but do not descend to locate
the leaf FocusScopeNode::focused_child the way
PreviouslyFocusedChild does.
Focusing the scope in this way clears the FocusScopeNode::focused_child history for
the enclosing scope when it receives focus. Because of this, calling a traversal method
like FocusNode.nextFocus after unfocusing will cause the FocusTraversalPolicy to
pick the node it thinks should be first in the scope.
This is the default disposition for AnyFocusNode::unfocus.
PreviouslyFocusedChild
Focus the previously focused child of the nearest focusable enclosing scope of this node.
If there is no previously focused child, then this is equivalent to using the
Scope disposition.
Unfocusing with this disposition will cause AnyFocusNode::unfocus to walk up the
tree to the nearest focusable enclosing scope, then start to walk down the tree, looking
for a focused child at its FocusScopeNode::focused_child.
If the FocusScopeNode::focused_child is a scope, then look for its
FocusScopeNode::focused_child, and so on, finding the leaf
FocusScopeNode::focused_child that is not a scope, or, failing that, a leaf scope
that has no focused child.
Trait Implementations§
Source§impl Clone for UnfocusDisposition
impl Clone for UnfocusDisposition
impl Copy for UnfocusDisposition
Source§impl Debug for UnfocusDisposition
impl Debug for UnfocusDisposition
Source§impl Default for UnfocusDisposition
impl Default for UnfocusDisposition
impl Eq for UnfocusDisposition
Source§impl PartialEq for UnfocusDisposition
impl PartialEq for UnfocusDisposition
impl StructuralPartialEq for UnfocusDisposition
Auto Trait Implementations§
impl Forget for UnfocusDisposition
impl Freeze for UnfocusDisposition
impl Move for UnfocusDisposition
impl RefUnwindSafe for UnfocusDisposition
impl Send for UnfocusDisposition
impl Sync for UnfocusDisposition
impl Unpin for UnfocusDisposition
impl UnsafeUnpin for UnfocusDisposition
impl UnwindSafe for UnfocusDisposition
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,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.