Skip to main content

WidgetExt

Trait WidgetExt 

Source
pub trait WidgetExt:
    Widget
    + Sized
    + 'static {
    // Provided method
    fn tooltip(self, label: impl Into<String>) -> Tooltip { ... }
}
Expand description

Ergonomic extension available on EVERY widget (D115/Phase 32): attach a tooltip as a PROPERTY instead of wrapping — Button::new("Save") .tooltip("Saves changes"). Desktop shows it on hover; mobile has no hover, so it’s naturally inert there (a long-press variant can hook the same path later). Styling comes from the theme’s TooltipStyle.

Provided Methods§

Source

fn tooltip(self, label: impl Into<String>) -> Tooltip

Show label while the pointer hovers this widget.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<W: Widget + Sized + 'static> WidgetExt for W