pub struct MaterialTooltip { /* private fields */ }Expand description
An M3 tooltip. With MaterialTooltip::trigger it wraps that element
and shows on hover and keyboard focus; without one it renders the tooltip
container in place (a specimen).
Implementations§
Source§impl MaterialTooltip
impl MaterialTooltip
Sourcepub fn plain(id: impl Into<ElementId>, text: impl Into<SharedString>) -> Self
pub fn plain(id: impl Into<ElementId>, text: impl Into<SharedString>) -> Self
A plain tooltip with text.
Sourcepub fn rich(
id: impl Into<ElementId>,
supporting: impl Into<SharedString>,
) -> Self
pub fn rich( id: impl Into<ElementId>, supporting: impl Into<SharedString>, ) -> Self
A rich tooltip with supporting text.
Sourcepub fn subhead(self, subhead: impl Into<SharedString>) -> Self
pub fn subhead(self, subhead: impl Into<SharedString>) -> Self
A rich tooltip’s title-small subhead.
Sourcepub fn action(self, action: impl IntoElement) -> Self
pub fn action(self, action: impl IntoElement) -> Self
An action of a rich tooltip; the tooltip then stays open while the pointer is over it.
Sourcepub fn placement(self, placement: Placement) -> Self
pub fn placement(self, placement: Placement) -> Self
The preferred side; it flips when the tooltip does not fit.
Sourcepub fn align(self, align: Align) -> Self
pub fn align(self, align: Align) -> Self
How the tooltip lines up with its trigger along the placement side: centered (default), or flush with the trigger’s start or end edge.
Sourcepub fn show_on_hover(self, show: bool) -> Self
pub fn show_on_hover(self, show: bool) -> Self
Whether hovering the trigger shows the tooltip (default true).
Sourcepub fn show_on_focus(self, show: bool) -> Self
pub fn show_on_focus(self, show: bool) -> Self
Whether keyboard focus in the trigger shows the tooltip (default true).
Sourcepub fn show_delay(self, delay: Duration) -> Self
pub fn show_delay(self, delay: Duration) -> Self
The hover delay before showing (default: Base’s show delay).
Sourcepub fn hide_delay(self, delay: Duration) -> Self
pub fn hide_delay(self, delay: Duration) -> Self
The grace period before hiding once input leaves (default: Base’s grace period).
Sourcepub fn force_visible(self, visible: bool) -> Self
pub fn force_visible(self, visible: bool) -> Self
Keep the tooltip shown (or hidden) regardless of input, e.g. for a captured demo.
Trait Implementations§
Source§impl IntoElement for MaterialTooltip
impl IntoElement for MaterialTooltip
Source§type Element = ViewElement<MaterialTooltip>
type Element = ViewElement<MaterialTooltip>
Source§fn into_element(self) -> Self::Element
fn into_element(self) -> Self::Element
Element].Source§fn into_any_element(self) -> AnyElement
fn into_any_element(self) -> AnyElement
AnyElement].Auto Trait Implementations§
impl !RefUnwindSafe for MaterialTooltip
impl !Send for MaterialTooltip
impl !Sync for MaterialTooltip
impl !UnwindSafe for MaterialTooltip
impl Freeze for MaterialTooltip
impl Unpin for MaterialTooltip
impl UnsafeUnpin for MaterialTooltip
Blanket Implementations§
§impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
impl<E> AnimationExt for Ewhere
E: IntoElement + 'static,
§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,
§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,
§fn with_spring<T>(
self,
id: impl Into<ElementId>,
animation: SpringAnimation<T>,
animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static,
) -> SpringAnimationElement<Self>where
Self: Sized,
T: SpringTarget,
<T as SpringTarget>::Output: 'static,
fn with_spring<T>(
self,
id: impl Into<ElementId>,
animation: SpringAnimation<T>,
animator: impl FnOnce(Self, <T as SpringTarget>::Output) -> Self + 'static,
) -> SpringAnimationElement<Self>where
Self: Sized,
T: SpringTarget,
<T as SpringTarget>::Output: 'static,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
impl<T> AutoreleaseSafe for Twhere
T: ?Sized,
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> FluentBuilder for Twhere
T: IntoElement,
impl<T> FluentBuilder for Twhere
T: IntoElement,
§fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
fn map<U>(self, f: impl FnOnce(Self) -> U) -> Uwhere
Self: Sized,
§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,
§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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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 more§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<E> TestTextExt for Ewhere
E: IntoElement,
impl<E> TestTextExt for Ewhere
E: IntoElement,
§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.§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.