pub struct TooltipProvider(/* private fields */);Expand description
Shared open timing for a group of tooltips, Base UI’s Tooltip.Provider.
Store one on the view and hand it to every TooltipState that should behave as one group.
The first tooltip waits for the full delay; while the group stays warm — a tooltip is open, or
one closed less than Self::timeout ago — the next adjacent trigger opens instantly, which is
what makes scanning a toolbar feel like one control rather than a row of independent waits.
The warm window is an exact one-shot deadline, not a clock poll: closing a grouped tooltip schedules one task, and opening another cancels it. A group with no tooltip open and no warm window outstanding owns nothing.
Implementations§
Source§impl TooltipProvider
impl TooltipProvider
Sourcepub fn new() -> Self
pub fn new() -> Self
Create a group with the default 600 ms delay, immediate close, and 400 ms warm window.
Sourcepub fn delay(self, delay: Duration) -> Self
pub fn delay(self, delay: Duration) -> Self
Set the group’s open delay, Base UI’s Provider delay.
Sourcepub fn close_delay(self, delay: Duration) -> Self
pub fn close_delay(self, delay: Duration) -> Self
Set the group’s close delay, Base UI’s Provider closeDelay.
Sourcepub fn timeout(self, timeout: Duration) -> Self
pub fn timeout(self, timeout: Duration) -> Self
Set how long the group stays warm after a tooltip closes, Base UI’s Provider timeout.
Sourcepub fn delay_value(&self) -> Duration
pub fn delay_value(&self) -> Duration
The group’s open delay.
Sourcepub fn close_delay_value(&self) -> Duration
pub fn close_delay_value(&self) -> Duration
The group’s close delay.
Sourcepub fn timeout_value(&self) -> Duration
pub fn timeout_value(&self) -> Duration
The group’s warm window.
Trait Implementations§
Source§impl Clone for TooltipProvider
impl Clone for TooltipProvider
Source§impl Debug for TooltipProvider
impl Debug for TooltipProvider
Source§impl Default for TooltipProvider
impl Default for TooltipProvider
Auto Trait Implementations§
impl !RefUnwindSafe for TooltipProvider
impl !Send for TooltipProvider
impl !Sync for TooltipProvider
impl !UnwindSafe for TooltipProvider
impl Forget for TooltipProvider
impl Freeze for TooltipProvider
impl Move for TooltipProvider
impl Unpin for TooltipProvider
impl UnsafeUnpin for TooltipProvider
Blanket Implementations§
impl<T> Action for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.