Class Tooltip
The tooltip popup type.
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public sealed class Tooltip : AnchorPopup<Tooltip>
Fields
defaultPlacement
The default placement of the tooltip.
Declaration
public const PopoverPlacement defaultPlacement = Bottom
Field Value
| Type | Description |
|---|---|
| PopoverPlacement |
Properties
template
The template to display inside the popup.
Declaration
public VisualElement template { get; }
Property Value
| Type | Description |
|---|---|
| VisualElement |
text
The text to display inside the popup.
Declaration
public string text { get; }
Property Value
| Type | Description |
|---|---|
| string |
Methods
AnimateViewIn()
Start the animation for this popup.
Declaration
protected override void AnimateViewIn()
Overrides
AnimateViewOut(DismissType)
Start the hide animation for this popup.
Declaration
protected override void AnimateViewOut(DismissType reason)
Parameters
| Type | Name | Description |
|---|---|---|
| DismissType | reason | The reason for the dismissal. |
Overrides
Build(VisualElement)
Build a new Tooltip.
Declaration
public static Tooltip Build(VisualElement referenceView)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | referenceView | An arbitrary UI element used as reference for the application context to attach to the popup. |
Returns
| Type | Description |
|---|---|
| Tooltip | A Tooltip instance. |
Remarks
In the Application element, only one Tooltip is create and moved at the right place when hovering others UI elements. The Tooltip is handled by the TooltipManipulator.
FindSuitableParent(VisualElement)
Find the parent VisualElement where the popup will be added.
Declaration
protected override VisualElement FindSuitableParent(VisualElement element)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | element | An arbitrary UI element inside the panel. |
Returns
| Type | Description |
|---|---|
| VisualElement | The popup container VisualElement in the current panel. |
Overrides
Remarks
This is usually one of the layers from the Panel root UI element.
SetContent(VisualElement)
Set the content of the tooltip.
Declaration
public Tooltip SetContent(VisualElement content)
Parameters
| Type | Name | Description |
|---|---|---|
| VisualElement | content | The content to display inside the tooltip. |
Returns
| Type | Description |
|---|---|
| Tooltip | The Tooltip. |
Remarks
Passing null will clear the content of the tooltip.
SetText(string)
Set a new value for the text property.
Declaration
public Tooltip SetText(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The new value (will be localized). |
Returns
| Type | Description |
|---|---|
| Tooltip | The Tooltip. |
ShouldAnimate()
Implement this method to know if the popup should call AnimateViewIn() and AnimateViewOut(DismissType) methods or not.
Declaration
protected override bool ShouldAnimate()
Returns
| Type | Description |
|---|---|
| bool |
|