pub struct Tooltip { /* private fields */ }Expand description
A transient plain or rich Material tooltip, or a persistent rich tooltip with caller-owned visibility.
Implementations§
Source§impl Tooltip
impl Tooltip
pub fn plain( id: impl Into<ElementId>, trigger: impl IntoElement, text: impl Into<SharedString>, ) -> Tooltip
pub fn rich( id: impl Into<ElementId>, trigger: impl IntoElement, title: impl Into<SharedString>, text: impl Into<SharedString>, ) -> Tooltip
Sourcepub fn shortcut(self, text: impl Into<SharedString>) -> Tooltip
pub fn shortcut(self, text: impl Into<SharedString>) -> Tooltip
Appends a subtle formatted desktop shortcut hint beside plain tooltip text or in a rich tooltip header/body while keeping the constructor’s text as the accessible description.
Sourcepub fn action(
self,
label: impl Into<SharedString>,
focus: &FocusHandle,
callback: impl Fn(&mut Window, &mut App) + 'static,
) -> Tooltip
pub fn action( self, label: impl Into<SharedString>, focus: &FocusHandle, callback: impl Fn(&mut Window, &mut App) + 'static, ) -> Tooltip
Adds a text button to a rich tooltip.
pub fn title_content(self, content: impl IntoElement) -> Tooltip
pub fn body_content(self, content: impl IntoElement) -> Tooltip
Sourcepub fn action_content(self, content: impl IntoElement) -> Tooltip
pub fn action_content(self, content: impl IntoElement) -> Tooltip
Replaces the standard action with caller-authored interactive content.
Sourcepub fn link(
self,
label: impl Into<SharedString>,
callback: impl Fn(&mut Window, &mut App) + 'static,
) -> Tooltip
pub fn link( self, label: impl Into<SharedString>, callback: impl Fn(&mut Window, &mut App) + 'static, ) -> Tooltip
Adds a semantic link. The callback owns the destination and navigation.
Sourcepub fn show_delay(self, delay: Duration) -> Tooltip
pub fn show_delay(self, delay: Duration) -> Tooltip
Overrides the pointer hover delay before showing a transient tooltip (default 500 ms).
Sourcepub fn hide_delay(self, delay: Duration) -> Tooltip
pub fn hide_delay(self, delay: Duration) -> Tooltip
Overrides the pointer leave grace delay before hiding a transient tooltip (default 200 ms).
Sourcepub fn track_focus(self, focus: &FocusHandle) -> Tooltip
pub fn track_focus(self, focus: &FocusHandle) -> Tooltip
Uses the trigger’s focus handle for keyboard activation and restoration.
Sourcepub fn focus_target(self, focus: &FocusHandle) -> Tooltip
pub fn focus_target(self, focus: &FocusHandle) -> Tooltip
Uses the caller’s first focus target inside the tooltip.
Sourcepub fn focusable(self, focusable: bool) -> Tooltip
pub fn focusable(self, focusable: bool) -> Tooltip
Moves focus to the tooltip when it opens. The default preserves focus.
Sourcepub fn enable_user_input(self, enable: bool) -> Tooltip
pub fn enable_user_input(self, enable: bool) -> Tooltip
Enables automatic trigger input for the chosen visibility mode.
Sourcepub fn persistent(self, state: &Entity<TooltipState>) -> Tooltip
pub fn persistent(self, state: &Entity<TooltipState>) -> Tooltip
Uses caller-owned visibility for a persistent rich tooltip.
Sourcepub fn on_dismiss_request(
self,
callback: impl Fn(&mut Window, &mut App) + 'static,
) -> Tooltip
pub fn on_dismiss_request( self, callback: impl Fn(&mut Window, &mut App) + 'static, ) -> Tooltip
Handles Escape or a persistent tooltip’s outside press. A persistent tooltip with a handler closes when the owner accepts the request.
pub fn placement(self, placement: TooltipPlacement) -> Tooltip
Sourcepub fn offset(self, offset: Pixels) -> Tooltip
pub fn offset(self, offset: Pixels) -> Tooltip
Gap between the trigger and surface in logical pixels.
Sourcepub fn positioner(
self,
positioner: impl Fn(Bounds<Pixels>, Size<Pixels>, Direction) -> Positioner + 'static,
) -> Tooltip
pub fn positioner( self, positioner: impl Fn(Bounds<Pixels>, Size<Pixels>, Direction) -> Positioner + 'static, ) -> Tooltip
Replaces the standard placement with a positioner built from the trigger bounds, viewport size, and direction. The host applies viewport margins.
pub fn caret(self, caret: TooltipCaret) -> Tooltip
pub fn max_width(self, width: Pixels) -> Tooltip
pub fn shape(self, shape: CornerShape) -> Tooltip
pub fn colors(self, colors: TooltipColors) -> Tooltip
pub fn tonal_elevation(self, elevation: Elevation) -> Tooltip
pub fn shadow_elevation(self, elevation: Elevation) -> Tooltip
Trait Implementations§
Source§impl IntoElement for Tooltip
impl IntoElement for Tooltip
Source§type Element = ViewElement<Tooltip>
type Element = ViewElement<Tooltip>
Source§fn into_element(self) -> <Tooltip as IntoElement>::Element
fn into_element(self) -> <Tooltip as IntoElement>::Element
Element.Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
AnyElement.Source§impl RenderOnce for Tooltip
impl RenderOnce for Tooltip
Source§fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
fn render(self, window: &mut Window, cx: &mut App) -> impl IntoElement
Render::render() method
which takes a mutable reference.Auto Trait Implementations§
impl !RefUnwindSafe for Tooltip
impl !Send for Tooltip
impl !Sync for Tooltip
impl !UnwindSafe for Tooltip
impl Forget for Tooltip
impl Freeze for Tooltip
impl Move for Tooltip
impl Unpin for Tooltip
impl UnsafeUnpin for Tooltip
Blanket Implementations§
Source§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
Source§fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animation(
self,
id: impl Into<ElementId>,
animation: Animation,
animator: impl Fn(Self, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Source§fn with_animations(
self,
id: impl Into<ElementId>,
animations: Vec<Animation>,
animator: impl Fn(Self, usize, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
fn with_animations(
self,
id: impl Into<ElementId>,
animations: Vec<Animation>,
animator: impl Fn(Self, usize, f32) -> Self + 'static,
) -> AnimationElement<Self>where
Self: Sized,
Source§fn with_spring<T>(
self,
id: impl Into<ElementId>,
animation: SpringAnimation<T>,
animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static,
) -> SpringAnimationElement<Self>
fn with_spring<T>( self, id: impl Into<ElementId>, animation: SpringAnimation<T>, animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static, ) -> SpringAnimationElement<Self>
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
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
Source§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
Source§fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
fn when(self, condition: bool, then: impl FnOnce(Self) -> Self) -> Selfwhere
Self: Sized,
Source§fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
fn when_else(
self,
condition: bool,
then: impl FnOnce(Self) -> Self,
else_fn: impl FnOnce(Self) -> Self,
) -> Selfwhere
Self: Sized,
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> ⓘ
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 moreSource§impl<T> MaterialElementExt for Twhere
T: IntoElement,
impl<T> MaterialElementExt for Twhere
T: IntoElement,
Source§fn badge_label(self, text: impl Into<SharedString>) -> Badge
fn badge_label(self, text: impl Into<SharedString>) -> Badge
Badge to this element’s upper trailing edge.Source§fn badge_count(self, count: usize, maximum: usize) -> Badge
fn badge_count(self, count: usize, maximum: usize) -> Badge
Badge to this element’s upper trailing edge.Source§fn tooltip(
self,
id: impl Into<ElementId>,
text: impl Into<SharedString>,
) -> Tooltip
fn tooltip( self, id: impl Into<ElementId>, text: impl Into<SharedString>, ) -> Tooltip
Tooltip.Menu.Menu
whose items are built lazily only while the menu is open.Source§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<E> TestTextExt for Ewhere
E: IntoElement,
impl<E> TestTextExt for Ewhere
E: IntoElement,
Source§fn test_text(self, text: impl Into<SharedString>) -> Self::Element
fn test_text(self, text: impl Into<SharedString>) -> Self::Element
test-support, records text each time the element paints.
Otherwise returns the element it builds.Source§fn test_alt_text(self, text: impl Into<SharedString>) -> Self::Element
fn test_alt_text(self, text: impl Into<SharedString>) -> Self::Element
Self::test_text for an image’s alternative text, which
stands in for what the element draws.