|
TachyonUI 0.1.0
High-performance UI for building tools.
|
Decides which element's tooltip shows: the hovered one after a delay, or at once for focus moved by the keyboard. More...
#include <gui_controls/gui_tooltip_manager.h>
Public Member Functions | |
| void | BeginFrame (ID currentHoveredID, ID currentFocusedID, float elapsedTimeSecs, bool hasMouseMove, bool hasMousePress, bool hasKeyboard, bool hasScroll, bool menuIsOpen, bool buttonHeld=false) |
| Updates the target from this frame's hover, focus and input; call before OnGUI. | |
| ID | GetActiveTargetID () const |
| The element the tooltip is for: the hovered one, or the focused one after a Tab. | |
| void | SetTargetAncestors (std::vector< ID > ancestors) |
| The elements that take the active target's states (PropagatesDescendantState); a tooltip on any of them shows too. | |
| bool | ShouldShow (ID targetID) |
| True when the tooltip for targetID should be shown this frame: it is the active target or one around it, and no other tooltip was shown this frame, so a control's own tooltip (declared first) wins over its container's. | |
| void | EndFrame () |
| Call after OnGUI. Hides the tooltip if nothing declared it this frame. | |
| bool | IsVisible () const |
| True while a tooltip is shown. | |
Public Attributes | |
| float | delaySeconds = 0.5f |
| hover time before a tooltip shows | |
| float | warmSeconds = 0.5f |
| after a tooltip was shown, the next shows at once for this long | |
| float | hideSeconds = 0.1f |
| a tooltip stays this long after its target is left | |
Decides which element's tooltip shows: the hovered one after a delay, or at once for focus moved by the keyboard.
Moving on from one tooltip to the next shows the next at once; leaving one keeps it a moment. Presses, keys, scrolling and open menus dismiss it, and none shows while a mouse button is held (a drag).
| void tachyon::TooltipManager::BeginFrame | ( | ID | currentHoveredID, |
| ID | currentFocusedID, | ||
| float | elapsedTimeSecs, | ||
| bool | hasMouseMove, | ||
| bool | hasMousePress, | ||
| bool | hasKeyboard, | ||
| bool | hasScroll, | ||
| bool | menuIsOpen, | ||
| bool | buttonHeld = false ) |
Updates the target from this frame's hover, focus and input; call before OnGUI.
|
inline |
The element the tooltip is for: the hovered one, or the focused one after a Tab.
|
inline |
The elements that take the active target's states (PropagatesDescendantState); a tooltip on any of them shows too.
Call after BeginFrame.
| bool tachyon::TooltipManager::ShouldShow | ( | ID | targetID | ) |
True when the tooltip for targetID should be shown this frame: it is the active target or one around it, and no other tooltip was shown this frame, so a control's own tooltip (declared first) wins over its container's.
A true result declares it, keeping it visible.
| void tachyon::TooltipManager::EndFrame | ( | ) |
Call after OnGUI. Hides the tooltip if nothing declared it this frame.
|
inline |
True while a tooltip is shown.
| float tachyon::TooltipManager::delaySeconds = 0.5f |
hover time before a tooltip shows
| float tachyon::TooltipManager::warmSeconds = 0.5f |
after a tooltip was shown, the next shows at once for this long
| float tachyon::TooltipManager::hideSeconds = 0.1f |
a tooltip stays this long after its target is left