#include <tooltip_window.hpp>
◆ Phase
| Enumerator |
|---|
| idle | Nothing showing, no pending show.
|
| pending | Hover-delay timer running, not yet visible.
|
| showing | Visible (possibly still fading in).
|
| hiding | Fade-out in progress.
|
◆ TooltipWindow()
| pulp::view::TooltipWindow::TooltipWindow |
( |
| ) |
|
|
default |
◆ auto_hide()
| float pulp::view::TooltipWindow::auto_hide |
( |
| ) |
const |
|
inline |
◆ cancel_pending()
| void pulp::view::TooltipWindow::cancel_pending |
( |
| ) |
|
|
inline |
Cancel any pending hover-delay without showing.
Cheap "user
moved off the target before the tooltip appeared" path.
◆ cursor_offset()
| Point pulp::view::TooltipWindow::cursor_offset |
( |
| ) |
const |
|
inline |
◆ fade_duration()
| float pulp::view::TooltipWindow::fade_duration |
( |
| ) |
const |
|
inline |
◆ hide()
| void pulp::view::TooltipWindow::hide |
( |
| ) |
|
|
inline |
Begin fade-out.
No-op when already idle/hiding. From pending (never appeared) jumps straight to idle without a fade.
◆ hover_delay()
| float pulp::view::TooltipWindow::hover_delay |
( |
| ) |
const |
|
inline |
◆ last_anchor()
| Point pulp::view::TooltipWindow::last_anchor |
( |
| ) |
const |
|
inline |
◆ move_to()
| void pulp::view::TooltipWindow::move_to |
( |
Point | anchor | ) |
|
|
inline |
Update the anchor position.
Useful while the pointer is moving over the same target — the tooltip follows it. No-op when idle.
◆ opacity()
| float pulp::view::TooltipWindow::opacity |
( |
| ) |
const |
|
inline |
◆ pending()
| bool pulp::view::TooltipWindow::pending |
( |
| ) |
const |
|
inline |
◆ phase()
| Phase pulp::view::TooltipWindow::phase |
( |
| ) |
const |
|
inline |
◆ position()
| Point pulp::view::TooltipWindow::position |
( |
| ) |
const |
|
inline |
◆ set_auto_hide()
| void pulp::view::TooltipWindow::set_auto_hide |
( |
float | seconds | ) |
|
|
inline |
When > 0, the tooltip auto-hides this many seconds after it becomes visible.
Default 0 (no auto-hide; the caller drives hide() on mouse-leave).
◆ set_cursor_offset()
| void pulp::view::TooltipWindow::set_cursor_offset |
( |
Point | offset | ) |
|
|
inline |
Pixel offset applied to anchor when computing the tooltip's rendered position.
Default (12, 18) — below + right of cursor.
◆ set_fade_duration()
| void pulp::view::TooltipWindow::set_fade_duration |
( |
float | seconds | ) |
|
|
inline |
◆ set_hover_delay()
| void pulp::view::TooltipWindow::set_hover_delay |
( |
float | seconds | ) |
|
|
inline |
Time in seconds the pointer must hover before the tooltip appears.
Default 0.6s.
◆ show()
| void pulp::view::TooltipWindow::show |
( |
std::string | text, |
|
|
Point | anchor ) |
|
inline |
Begin showing a tooltip near anchor.
Anchor is in whatever coordinate space the host wants (typically window-local or screen-local — TooltipWindow stores it verbatim).
The tooltip is not immediately visible: it waits hover_delay() seconds (default 0.6s) before fading in. Calling show() again with the same anchor is a no-op; calling it with a different anchor while pending resets the timer; calling it while already showing updates the anchor (move_to behavior).
◆ text()
| const std::string & pulp::view::TooltipWindow::text |
( |
| ) |
const |
|
inline |
◆ tick()
| bool pulp::view::TooltipWindow::tick |
( |
float | dt | ) |
|
|
inline |
Advance time.
Drives hover-delay, fade animations, and auto-hide. Returns true while any work remains (delay running, animation running, or visible+auto_hide armed).
◆ visible()
| bool pulp::view::TooltipWindow::visible |
( |
| ) |
const |
|
inline |
True once the tooltip is past the hover-delay (showing or hiding).
Hosts should paint when this is true and opacity > 0.
◆ on_phase_change
| std::function<void(Phase)> pulp::view::TooltipWindow::on_phase_change |
Optional observer fired on every phase transition.
The documentation for this class was generated from the following file: