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
content
The content Visual Element of the tooltip (if any).
Declaration
public VisualElement content { get; }
Property Value
Type | Description |
---|---|
VisualElement |
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
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.
Exceptions
Type | Condition |
---|---|
ArgumentNullException | If |
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. If no Panel is found, the method will return the visual tree root of the given 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 |
|