|
Window Framework for UI Toolkit v2.0.x
|
Represents a tooltip element that displays contextual information for UI elements. The tooltip can be styled dynamically based on the current theme and supports fade-in and fade-out animations. More...


Public Member Functions | |
| WindowFrameTooltip () | |
| Initializes a new instance of the WindowFrameTooltip class. Sets up the tooltip's default styles and registers theme update callbacks. | |
| void | CancelFadeAndRestore () |
| Cancels any scheduled fade-out or dismissal and smoothly restores the tooltip to full opacity. | |
| void | Close () |
| Closes the tooltip and applies fade-out animation if enabled. | |
| void | CloseNow () |
| Immediately closes the tooltip by pausing its associated task, resetting it, and updating the tooltip's visibility and opacity styles to make it hidden. | |
| void | Show (VisualElement target) |
| Displays the tooltip near the specified target element. Positions the tooltip based on hints in the target's tooltip text. | |
| void | Show (VisualElement target, Vector2? pointerPosition) |
| Displays the tooltip near the specified target element or pointer position. Positions the tooltip accurately while ensuring it stays within the visible screen area. | |
Properties | |
| VisualElement | CurrentTarget [get] |
| Gets the VisualElement target for which the tooltip is currently displayed or scheduled. | |
| bool | IsOpen [get] |
| Gets whether a target exists, visibility is Visible and current opacity is greater than zero. | |
Private Member Functions | |
| void | AttachTargetListeners (VisualElement target) |
| void | DetachTargetListeners () |
| void | FadeInTooltip () |
| void | FadeOutTooltip () |
| void | OnAttachToPanel (AttachToPanelEvent evt) |
| void | OnDetachFromPanel (DetachFromPanelEvent evt) |
| void | OnTargetDetached (DetachFromPanelEvent evt) |
| void | UpdatePosition (VisualElement target, char hint, Vector2? pointerPosition) |
| void | UpdateTheme (List< StyleSheet > sheets, List< StyleSheet > oldTheme) |
| Updates tooltip sheet references when the controller publishes a theme change. | |
Static Private Member Functions | |
| static string | GetElementIdentifier (VisualElement element) |
| Produces a human and machine-readable identifier for any VisualElement, falling back to class names or type when name is empty. | |
Private Attributes | |
| float | _currentOpacity = 0f |
| VisualElement | _currentTarget |
| IVisualElementScheduledItem | _fadeTask |
| Label | _label |
| IVisualElementScheduledItem | _showTask |
| EventCallback< DetachFromPanelEvent > | _targetDetachCallback |
| TooltipFadeType | _tooltipFadeType |
Represents a tooltip element that displays contextual information for UI elements. The tooltip can be styled dynamically based on the current theme and supports fade-in and fade-out animations.
Controller-managed contextual tooltip with scheduled measurement and fade behavior.
Not currently registered as a UXML custom element. Show/Close use the existing controller/root and target lifecycle; the tooltip does not own application target resources.
|
inline |
Initializes a new instance of the WindowFrameTooltip class. Sets up the tooltip's default styles and registers theme update callbacks.


|
inlineprivate |


|
inline |
Cancels any scheduled fade-out or dismissal and smoothly restores the tooltip to full opacity.
If the tooltip is currently waiting out its hide delay or is in the middle of a fade-out animation, calling this method cancels the scheduled hide operation and fades the tooltip back up to full opacity.


|
inline |
Closes the tooltip and applies fade-out animation if enabled.
Begins the tooltip hiding sequence. If the tooltip is currently mid-fade or not fully opaque, it transitions immediately to fading out without extra delay. When fully visible, it waits for the configured WindowFrameController.TooltipFadeDelay before starting the smooth fade-out. If fade animations are disabled, the tooltip is hidden immediately.

|
inline |
Immediately closes the tooltip by pausing its associated task, resetting it, and updating the tooltip's visibility and opacity styles to make it hidden.
Bypasses any hide delay or fade animations to instantly make the tooltip invisible and reset its opacity. Ideal for scenarios like pointer clicks, window dragging, or context menu activations.


|
inlineprivate |

|
inlineprivate |


|
inlineprivate |


|
inlinestaticprivate |
Produces a human and machine-readable identifier for any VisualElement, falling back to class names or type when name is empty.

|
inlineprivate |


|
inlineprivate |


|
inlineprivate |


|
inline |
Displays the tooltip near the specified target element. Positions the tooltip based on hints in the target's tooltip text.
| target | The UI element to display the tooltip for. |
Evaluates positioning hints within the target's tooltip text (e.g., 'T:', 'B:', 'L:', 'R:'). Positions the tooltip relative to the target element and applies configured show delays and fade transitions.


|
inline |
Displays the tooltip near the specified target element or pointer position. Positions the tooltip accurately while ensuring it stays within the visible screen area.
| target | The UI element to display the tooltip for. |
| pointerPosition | Optional pointer position for cursor-relative placement. |
Computes screen-aware positioning using parent-local coordinate transformation. Flips vertically or horizontally if the tooltip would otherwise exceed container boundaries, and applies smooth frame-based fading according to the active TooltipFadeType. When transitioning from a currently open tooltip on a different element, overrides the hover timer and fade-in animation, immediately displaying the tooltip at full opacity over the new element.

|
inlineprivate |

|
inlineprivate |
Updates tooltip sheet references when the controller publishes a theme change.
| sheets | New composed sheets, or null to add none. |
| oldTheme | Published previous sheets. Nonempty lists are removed individually. |
The existing empty oldTheme branch clears the entire tooltip stylesheet set. This differs from the WindowFrame managed-assignment contract and is an audit finding, not recommended consumer code. Documentation work does not silently change that branch.

|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
get |
Gets the VisualElement target for which the tooltip is currently displayed or scheduled.
Tracks the element currently owning the active tooltip. Returns null when the tooltip is closed.
|
get |
Gets whether a target exists, visibility is Visible and current opacity is greater than zero.
Pending cold-start requests at zero opacity return false even though CurrentTarget is set. This is an appearance-state query, not a scheduler-completion or input-interactivity guarantee.