Skip to main content

Module tooltip

Module tooltip 

Source
Expand description

Tooltip system — hover-triggered overlays with configurable delay.

Three tiers, increasing in expressive power:

  • TooltipWidget — single line of localized text in a themed rounded rect. Attached via the per-widget .tooltip(...) setter.
  • RichTooltipWidgetTooltipContent-driven (body + optional long-form “more” disclosure + shortcut chip), inline-markup body so [label](:key) cascade links resolve against TooltipRegistry. Attached via .rich_tooltip(key) / .rich_tooltip_content(content). On dwell it flips its AT role to Role::Dialog and advertises a Focus action — keyboard focus is not auto-transferred; the user Tabs in (the correct non-modal-panel a11y pattern).
  • composite::CompositeTooltipWidget — hosts an arbitrary impl Widget + 'static body inside the same chrome with a larger surface budget. Crusader Kings 3-style: tabbed sections, charts, progress bars, conditional rows. Attached via .composite_tooltip(content). “Primary-only” by construction — has no inline-markup body and no registry key, so it cannot be the target of a [label](:key) cascade. Child widgets inside the body keep their own tooltip setters and cascade normally.

All three tiers share the same overlay machinery, hover/focus tracking, and dwell-promotion timer in teksilo-core. The per-widget setters (.tooltip / .rich_tooltip / .composite_tooltip) are mutually exclusive (last-one-wins): each setter clears the others.

§Example — plain tooltip

let _tip = TooltipWidget::new(lit!("Save the current file"));

Re-exports§

pub use attach::RichTooltipSource;
pub use attach::attach_composite_tooltip;
pub use attach::attach_composite_tooltip_boxed;
pub use attach::attach_composite_tooltip_boxed_with_placement;
pub use attach::attach_composite_tooltip_widget_with_placement;
pub use attach::attach_plain_tooltip;
pub use attach::attach_plain_tooltip_with_placement;
pub use attach::attach_rich_tooltip;
pub use attach::attach_rich_tooltip_content;
pub use attach::attach_rich_tooltip_content_with_placement;
pub use attach::attach_rich_tooltip_source;
pub use attach::attach_rich_tooltip_source_with_placement;
pub use attach::attach_rich_tooltip_with_placement;
pub use composite::CompositeTooltipWidget;
pub use registry::TooltipContent;
pub use registry::TooltipRegistry;
pub use registry::install_tooltip_registry;
pub use registry::with_tooltip_registry;
pub use rich::RichTooltipWidget;

Modules§

attach
Rich-tooltip attachment helpers.
composite
CompositeTooltipWidget — third-tier tooltip that hosts an arbitrary widget tree as its body.
registry
Tooltip content registry.
rich
RichTooltipWidget — rich tooltip content surface.

Structs§

TooltipWidget
A tooltip content widget — a themed rounded rect with text.

Enums§

TooltipPlacement
Where a tooltip opens relative to its anchor — re-exported from teksilo-core so widgets can request Side placement in a vertical list without naming the core path. Placement preference for a tooltip relative to its anchor. Resolved to a concrete [OverlayPlacement] at show time (see WidgetTree::tooltip_overlay_placement).