pub struct HoverCard { /* private fields */ }Expand description
A preview surface that opens on hover and can be pointed at.
Implementations§
Source§impl HoverCard
impl HoverCard
pub fn new( ident: impl Into<Ident>, _window: &mut Window, cx: &mut Context<'_, Self>, ) -> Self
Sourcepub fn trigger(
self,
trigger: impl Fn(&mut Window, &mut App) -> AnyElement + 'static,
) -> Self
pub fn trigger( self, trigger: impl Fn(&mut Window, &mut App) -> AnyElement + 'static, ) -> Self
Supplies what is hovered, rebuilt on every frame.
Sourcepub fn name(self, name: impl Into<SharedString>) -> Self
pub fn name(self, name: impl Into<SharedString>) -> Self
Names the trigger. A preview hanging off a picture or an avatar has no words of its own, and a control nobody can name is one nobody can reach.
Sourcepub fn content(
self,
content: impl Fn(&mut Window, &mut App) -> AnyElement + 'static,
) -> Self
pub fn content( self, content: impl Fn(&mut Window, &mut App) -> AnyElement + 'static, ) -> Self
Supplies the card body, rebuilt on every frame the card is open.
pub fn placement(self, placement: Placement) -> Self
Sourcepub fn open_delay(self, delay: Duration) -> Self
pub fn open_delay(self, delay: Duration) -> Self
How long the pointer rests before the card opens. Zero opens at once.
Sourcepub fn grace(self, grace: Duration) -> Self
pub fn grace(self, grace: Duration) -> Self
How long the card survives the pointer being over neither surface.
pub fn is_open(&self) -> bool
Sourcepub fn is_leaving(&self) -> bool
pub fn is_leaving(&self) -> bool
True while the card is on screen with the pointer over neither surface, which is the window during which the trip can still be completed.
pub fn grace_period(&self) -> Duration
pub fn open(&mut self, cx: &mut Context<'_, Self>)
Trait Implementations§
impl EventEmitter<HoverCardEvent> for HoverCard
Source§impl Focusable for HoverCard
impl Focusable for HoverCard
Source§fn focus_handle(&self, _cx: &App) -> FocusHandle
fn focus_handle(&self, _cx: &App) -> FocusHandle
Returns the focus handle associated with this view.
Auto Trait Implementations§
impl !RefUnwindSafe for HoverCard
impl !Send for HoverCard
impl !Sync for HoverCard
impl !UnwindSafe for HoverCard
impl Freeze for HoverCard
impl Unpin for HoverCard
impl UnsafeUnpin for HoverCard
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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 more