Expand description
Tooltip — a wrapper widget that shows a hover tooltip.
Wraps any child widget and renders a small info panel near the cursor when
the user hovers over the child. The panel appears after a short delay
(HOVER_DELAY_FRAMES) and is rendered inline within the widget’s own paint()
call, which means it renders within the widget’s local clip region.
§Limitations
Because the tooltip is painted in local coordinate space it will be clipped by
the parent ScrollView if the child is near the edge. True floating tooltips
require a global overlay layer. This implementation covers the common case
where the tooltip fits within the visible widget area.
§Usage
ⓘ
Tooltip::new(
Box::new(Button::new("Hover me", font.clone()).on_click(|| {})),
"This is a tooltip",
font.clone(),
)Structs§
- Tooltip
- A wrapper widget that shows a text tooltip on hover.