Skip to main content

Module rich

Module rich 

Source
Expand description

RichTooltipWidget — rich tooltip content surface.

Renders a TooltipContent entry (body + optional shortcut hint + optional “more” disclosure) inside the existing tooltip rounded-rect chrome. Body and long-form text go through TextWidget with inline markup enabled, so [label](url) / *italic* / **bold** render correctly and inline links participate in the nested-tooltip cascade.

This widget is the content of a tooltip overlay — the anchor / hover trigger / overlay lifetime live in the surrounding attach API. A caller (the owning widget’s build) wraps a RichTooltipWidget into an OverlayRequest or attaches it via the simple tooltip attach API once that integration lands.

Sticky-on-dwell:

  • At t=0 the tooltip is shown by the normal hover path.
  • The widget tracks visible-paint time via paint() interior mutability and, every 500 ms, advances a Signal<u32> step counter from 0 to 4.
  • The top-right DwellIndicator reads the step signal and paints an empty circle filling progressively in 4 wedges.
  • At step 4 the indicator flips to a pin icon and the widget’s sticky signal goes true. The widget tree (via attach_tooltip_with_sticky) auto-promotes the overlay on the same 2 s timer: removes the entry from the hover tracker and swaps the dismiss behavior to EscapeOrClickOutside. The widget’s a11y role flips from Tooltip to Dialog and a Focus action is advertised on the node. Promotion does not move keyboard focus into the panel — the user Tabs in. This is the correct pattern for a non-modal sticky panel (it never steals focus from whatever the user was doing).
  • Cascade children (tooltips opened from a [label](:key) link via RichTooltipWidget::cascade_child) omit the indicator entirely: they’re shown by an explicit click and are already persistent, so there’s no hover dwell-to-sticky path to visualize. They also skip straight to the persistent a11y treatment — a non-modal Dialog advertising Focus, same as a dwell-promoted tooltip — rather than reading as an ephemeral Tooltip.

Structs§

RichTooltipWidget
Rich tooltip content widget.