pub struct FocusFlag(/* private fields */);Expand description
Holds the flags for the focus.
Add this to the widget state.
This struct is intended to be cloned and uses a Rc internally to share the state.
Attention Equality for FocusFlag means pointer-equality of the underlying Rc using Rc::ptr_eq.
See HasFocusFlag, on_gained! and on_lost!.
See FocusAdapter to use with widgets that don’t have their own focus flag.
Implementations§
Trait Implementations§
source§impl HasFocusFlag for FocusFlag
impl HasFocusFlag for FocusFlag
source§fn z_areas(&self) -> &[ZRect]
fn z_areas(&self) -> &[ZRect]
The widget might have several disjointed/overlapping areas.
This is the case if it is showing a popup, but there might be other causes. Read more
Declares how the widget interacts with focus. Read more
source§fn is_focused(&self) -> bool
fn is_focused(&self) -> bool
Focused?
source§fn lost_focus(&self) -> bool
fn lost_focus(&self) -> bool
Just lost focus.
source§fn gained_focus(&self) -> bool
fn gained_focus(&self) -> bool
Just gained focus.
source§impl PartialEq for FocusFlag
impl PartialEq for FocusFlag
Equality for FocusFlag means pointer equality of the underlying Rc using Rc::ptr_eq.
impl Eq for FocusFlag
Auto Trait Implementations§
impl Freeze for FocusFlag
impl !RefUnwindSafe for FocusFlag
impl !Send for FocusFlag
impl !Sync for FocusFlag
impl Unpin for FocusFlag
impl !UnwindSafe for FocusFlag
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)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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 moresource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
Fallible version of
ToCompactString::to_compact_string() Read moresource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
Converts the given value to a
CompactString. Read more