Struct gpui2::FocusHandle
source · pub struct FocusHandle { /* private fields */ }
Expand description
A handle which can be used to track and manipulate the focused element in a window.
Implementations§
source§impl FocusHandle
impl FocusHandle
sourcepub fn focus(&self, cx: &mut WindowContext<'_>)
pub fn focus(&self, cx: &mut WindowContext<'_>)
Moves the focus to the element associated with this handle.
sourcepub fn is_focused(&self, cx: &WindowContext<'_>) -> bool
pub fn is_focused(&self, cx: &WindowContext<'_>) -> bool
Obtains whether the element associated with this handle is currently focused.
sourcepub fn contains_focused(&self, cx: &WindowContext<'_>) -> bool
pub fn contains_focused(&self, cx: &WindowContext<'_>) -> bool
Obtains whether the element associated with this handle contains the focused element or is itself focused.
sourcepub fn within_focused(&self, cx: &WindowContext<'_>) -> bool
pub fn within_focused(&self, cx: &WindowContext<'_>) -> bool
Obtains whether the element associated with this handle is contained within the focused element or is itself focused.
Trait Implementations§
source§impl Clone for FocusHandle
impl Clone for FocusHandle
source§impl Debug for FocusHandle
impl Debug for FocusHandle
source§impl Drop for FocusHandle
impl Drop for FocusHandle
source§impl<'a> From<&'a FocusHandle> for ElementId
impl<'a> From<&'a FocusHandle> for ElementId
source§fn from(handle: &'a FocusHandle) -> Self
fn from(handle: &'a FocusHandle) -> Self
Converts to this type from the input type.
source§impl PartialEq<FocusHandle> for FocusHandle
impl PartialEq<FocusHandle> for FocusHandle
impl Eq for FocusHandle
Auto Trait Implementations§
impl !RefUnwindSafe for FocusHandle
impl Send for FocusHandle
impl Sync for FocusHandle
impl Unpin for FocusHandle
impl !UnwindSafe for FocusHandle
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.