Skip to main content

Module tooltip

Module tooltip 

Source
Available on crate feature tooltip only.
Expand description

A small label shown while the pointer rests on an element, or while something inside the element has keyboard focus.

A finger shows it while held. Once the finger lifts, the bubble stays closed until a mouse is used, so a tap on a phone does not leave it open.

iced has no general focus model, so the tooltip follows the widgets that report focus to operations: text fields, text editors and the focusable parts of this library. Focus that arrives with a pointer press, such as clicking into a field, does not show the bubble.

Structs§

Tooltip
A tooltip builder. Convert it into an Element to render.

Enums§

Focus
How focus reached the content, if it has it.
Position
Where the bubble appears relative to its element.

Constants§

EDGE
The bubble’s margin: the closest it comes to the window edges, and part of the space between it and its element.
GAP
Gap between the element and the bubble’s margin, in logical pixels.
LONG_LABEL
Labels longer than this many characters are sentences rather than names, and read at text_size::SM instead of text_size::XS.

Functions§

label_size
The text size of the bubble: explicit when set, otherwise small for a short label and a size up for a longer one.
style
The bubble style: inverted colours so it stands out from the page.
tooltip
Shows label in a bubble while the pointer is over content, or while something inside content has keyboard focus.