Skip to main content

Module attach

Module attach 

Source
Expand description

Rich-tooltip attachment helpers.

Widgets call attach_rich_tooltip (or attach_rich_tooltip_content) from their build() to wire a hover-triggered RichTooltipWidget onto an anchor. The helper:

  1. Creates a dormant RichTooltipWidget as a child of the current build context,
  2. Registers it with the widget tree’s tooltip-attachment table via [BuildContext::attach_tooltip], so hover enter/leave + delay timing + overlay show/hide are handled by the same machinery the plain TooltipWidget already uses.

This is a thin convenience layer — the full attach lifecycle lives in teksilo_core::widget_tree::overlay_impl::attach_tooltip, which takes any content_id and doesn’t care whether it wraps plain text or rich content. Rich tooltips drop into the existing hover plumbing without a separate attachment path.

Enums§

RichTooltipSource
Source resolution for a rich tooltip — either a registry key (the common path) or an inline TooltipContent entry (one-offs that don’t belong in the app-wide registry).

Functions§

attach_composite_tooltip
Attach a composite tooltip — third tier, hosting an arbitrary impl Widget + 'static body. Wires the same dwell-to-sticky machinery rich tooltips use, so the surface promotes to a Role::Dialog after the user dwells for DWELL_PROMOTION.
attach_composite_tooltip_boxed
Variant of attach_composite_tooltip that takes an already-boxed body. Used by per-widget .composite_tooltip(...) setters that store Box<dyn Widget> so the user-supplied content can survive across the borrow boundary into build().
attach_composite_tooltip_boxed_with_placement
attach_composite_tooltip_widget_with_placement
attach_composite_tooltip_boxed with an explicit TooltipPlacement. Attach an already-built CompositeTooltipWidget, honouring its own sticky setting.
attach_plain_tooltip
Attach a plain tooltip — first tier, a single line of text.
attach_plain_tooltip_with_placement
attach_plain_tooltip with an explicit TooltipPlacement — what the widgets that live in a vertical list (menu items, standard items, tab headers) want, so the tip lands beside the row rather than under it.
attach_rich_tooltip
Attach a rich tooltip to anchor_id. Creates a RichTooltipWidget resolving key from the registry and wires it into the existing tooltip-hover machinery.
attach_rich_tooltip_content
Attach a rich tooltip driven by an inline TooltipContent entry. Use this for one-off tooltips that don’t live in the central registry (tests, dynamic content, per-row tips on data-driven widgets).
attach_rich_tooltip_content_with_placement
attach_rich_tooltip_content with an explicit TooltipPlacement.
attach_rich_tooltip_source
Attach a rich tooltip from a RichTooltipSource. Matches whether the source is a registry key or inline content and forwards to the appropriate helper. Convenient for builder methods that accept impl Into<RichTooltipSource> so callers can pass either a bare &str (resolved as a key) or a fully-built TooltipContent.
attach_rich_tooltip_source_with_placement
attach_rich_tooltip_source with an explicit TooltipPlacement — the placement-aware entry point used by widgets that live in a vertical list (menu items, list/tree rows, activity-rail items) and want Side.
attach_rich_tooltip_with_placement
attach_rich_tooltip with an explicit TooltipPlacement — pass Side for anchors stacked vertically (menu items, a vertical tab strip, list/tree rows) so the tooltip opens beside the anchor.