Expand description
Hover-delay tooltip widget driven by markup <tooltip text="Save" delay="500">...trigger...</tooltip>.
- The single child is the trigger; the tooltip remains invisible until the trigger has carried
Hoveredfordelaymilliseconds (default 500,--lumen-tooltip-delaytoken). - The trigger entity carries
TooltipSource; the first tick ofHoveredrecordsHoverStartedAt. - Once dwell exceeds the configured delay, a
TooltipPopupentity is spawned below-right of the CURSOR (QtQToolTipplacement), flipping above/left near viewport edges - seecursor_tooltip_origin. - The popup despawns one tick after
Hoveredclears.
§Canonical #[derive(Widget)] port
Tooltip is the reference port to the new
lumen_widget_macros::Widget derive. TooltipSource carries
#[derive(Widget)] with tag = "tooltip", which emits a
lumen_widget::Widget impl (parser-tag accessor + spawn glue) so
a runtime registry can wire <tooltip text="..."> markup to this
component without the previous hand-coded
if tag == "tooltip" { ... } branch in lumenc::parse::html.
The four per-tick systems remain hand-written (the #[widget(prop)]
/#[widget(state)] attributes only cover marker-component
authoring; system bodies stay author-supplied for v1). The plugin
struct is also hand-written (via #[widget(plugin = "TooltipPlugin")]) because the four systems need to be installed
in a specific tick stage - the canned no-op plugin emitted by the
derive can’t do that yet.
Structs§
- Hover
Started At - Per-entity timestamp of when
Hoveredwas first inserted. Recorded onAdded<Hovered>and used to compute dwell time before the tooltip popup is allowed to appear. - Tooltip
Plugin - Plugin: registers the four tooltip systems and a default
classrule via the LSP completion tables. No render path of its own - the popup is just an<overlay>-shaped entity with aVisualsfill +TextContent, so all standard styling (CSS.tooltipselector, hover-bg, opacity) works. - Tooltip
Popup - Marker on the spawned popup entity. Tracks which trigger the popup belongs to so the cleanup pass knows what to despawn when the trigger un-hovers.
- Tooltip
Source - Authored on the trigger via
<tooltip text="..." delay="...">. The markup parser attaches this component on the SINGLE child the<tooltip>wraps -<tooltip>itself is a no-op container in the layout tree.
Functions§
- cursor_
tooltip_ origin - Cursor-relative tooltip origin (Qt
QToolTipplacement): the popup sits below-right of the cursor hotspot,offsetpx away on each axis. When the preferred spot would overflow the viewport, each axis flips independently to the cursor’s other side (above / left), saturating at 0 so the popup never leaves the window.