Pulp 1.88.0
Cross-platform audio plugin framework
Loading...
Searching...
No Matches
tooltip_window.hpp File Reference

TooltipWindow — transient floating tooltip near the cursor. More...

#include <algorithm>
#include <functional>
#include <string>
#include <pulp/view/animation.hpp>
#include <pulp/view/geometry.hpp>
#include <pulp/view/motion_preferences.hpp>

Go to the source code of this file.

Classes

class  pulp::view::TooltipWindow

Namespaces

namespace  pulp
namespace  pulp::view
 Hover-cursor tracking for platform window hosts.

Detailed Description

TooltipWindow — transient floating tooltip near the cursor.

A TooltipWindow is a tiny stateful holder that drives a tooltip "popup" near a pointer:

  • show(text, anchor) — start a hover-delay timer; once elapsed the tooltip is visible() and position() is anchored to the last anchor. Fade-in honors MotionPreferences via ValueAnimation (motion off → snap to full opacity).
  • move_to(anchor) — update the anchor position while the tooltip is already showing (mouse moved within the same hover).
  • hide() — fade out; once elapsed the tooltip is no longer visible.
  • tick(dt) — drives the hover-delay timer + auto-hide timer + fade animations. Headless tests can call this directly.

The "window" half of the name is conceptual — TooltipWindow does not own an OS window. It owns the state of a floating tooltip that a host (the editor's overlay layer, a window manager, a design-tool inspector) is free to render however it likes. Hosts observe visible(), opacity(), position(), and text() and paint accordingly.

Headless-friendly: no scheduler, no OS coupling. Everything time- related is driven by tick(dt), so unit tests can drain timers without sleeping.

License-lineage note: the name is Pulp-native.