Struct Tooltip

Source
pub struct Tooltip<'a> {
    pub popup: Popup<'a>,
    /* private fields */
}

Fields§

§popup: Popup<'a>

Implementations§

Source§

impl Tooltip<'_>

Source

pub fn new( parent_widget: Id, ctx: Context, anchor: impl Into<PopupAnchor>, parent_layer: LayerId, ) -> Self

👎Deprecated: Use Tooltip::always_open instead.

Show a tooltip that is always open.

Source

pub fn always_open( ctx: Context, parent_layer: LayerId, parent_widget: Id, anchor: impl Into<PopupAnchor>, ) -> Self

Show a tooltip that is always open.

Source

pub fn for_widget(response: &Response) -> Self

Show a tooltip for a widget. Always open (as long as this function is called).

Source

pub fn for_enabled(response: &Response) -> Self

Show a tooltip when hovering an enabled widget.

Source

pub fn for_disabled(response: &Response) -> Self

Show a tooltip when hovering a disabled widget.

Source

pub fn at_pointer(self) -> Self

Show the tooltip at the pointer position.

Source

pub fn gap(self, gap: f32) -> Self

Set the gap between the tooltip and the anchor

Default: 5.0

Source

pub fn layout(self, layout: Layout) -> Self

Set the layout of the tooltip

Source

pub fn width(self, width: f32) -> Self

Set the width of the tooltip

Source

pub fn show<R>( self, content: impl FnOnce(&mut Ui) -> R, ) -> Option<InnerResponse<R>>

Show the tooltip

Source

pub fn seconds_since_last_tooltip(ctx: &Context) -> f32

Source

pub fn next_tooltip_id(ctx: &Context, widget_id: Id) -> Id

What is the id of the next tooltip for this widget?

Source

pub fn tooltip_id(widget_id: Id, tooltip_count: usize) -> Id

Source

pub fn should_show_tooltip(response: &Response) -> bool

Should we show a tooltip for this response?

Source

pub fn was_tooltip_open_last_frame(ctx: &Context, widget_id: Id) -> bool

Was this tooltip visible last frame?

Auto Trait Implementations§

§

impl<'a> Freeze for Tooltip<'a>

§

impl<'a> !RefUnwindSafe for Tooltip<'a>

§

impl<'a> Send for Tooltip<'a>

§

impl<'a> Sync for Tooltip<'a>

§

impl<'a> Unpin for Tooltip<'a>

§

impl<'a> !UnwindSafe for Tooltip<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.