Class Panel
This is the main UI element of any Runtime App. The Panel class will create different UI layers for the main user-interface, popups, notifications and tooltips.
Implements
Inherited Members
Namespace: Unity.AppUI.UI
Assembly: Unity.AppUI.dll
Syntax
public class Panel : VisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle
Constructors
Panel()
Default constructor.
Declaration
public Panel()
Fields
contextPrefix
Prefix used in App UI context USS classes.
Declaration
public const string contextPrefix = "appui--"
Field Value
Type | Description |
---|---|
string |
mainContainerName
The name of the main UI layer.
Declaration
public const string mainContainerName = "main-container"
Field Value
Type | Description |
---|---|
string |
notificationContainerName
The name of the Notifications layer.
Declaration
public const string notificationContainerName = "notification-container"
Field Value
Type | Description |
---|---|
string |
popupContainerName
The name of the Popups layer.
Declaration
public const string popupContainerName = "popup-container"
Field Value
Type | Description |
---|---|
string |
tooltipContainerName
The name of the Tooltip layer.
Declaration
public const string tooltipContainerName = "tooltip-container"
Field Value
Type | Description |
---|---|
string |
ussClassName
Main Uss Class Name.
Declaration
public const string ussClassName = "appui"
Field Value
Type | Description |
---|---|
string |
Properties
contentContainer
The main UI layer container.
Declaration
public override VisualElement contentContainer { get; }
Property Value
Type | Description |
---|---|
VisualElement |
Overrides
forceUseTooltipSystem
If true, the panel will use the tooltip system, even if the default UI-Toolkit tooltips are enabled.
Declaration
[Tooltip("Force the use of the tooltip system, even if the default UI-Toolkit tooltips are enabled.")]
public bool forceUseTooltipSystem { get; set; }
Property Value
Type | Description |
---|---|
bool |
lang
The default language for this panel.
Declaration
[Tooltip("The default language for this panel.")]
public string lang { get; set; }
Property Value
Type | Description |
---|---|
string |
layoutDirection
The default layout direction for this panel.
Declaration
[Tooltip("The default layout direction for this panel.")]
public Dir layoutDirection { get; set; }
Property Value
Type | Description |
---|---|
Dir |
notificationContainer
The Notifications layer container.
Declaration
public VisualElement notificationContainer { get; }
Property Value
Type | Description |
---|---|
VisualElement |
popupContainer
The Popups layer container.
Declaration
public VisualElement popupContainer { get; }
Property Value
Type | Description |
---|---|
VisualElement |
preferredTooltipPlacement
The default preferred tooltip placement for this panel.
Declaration
[Tooltip("The default preferred tooltip placement for this panel.\nNote that this is just the ideal placement, the tooltip will be placed on the opposite side if there is not enough space.")]
public PopoverPlacement preferredTooltipPlacement { get; set; }
Property Value
Type | Description |
---|---|
PopoverPlacement |
Remarks
Note that this is just the ideal placement, the tooltip will be placed on the opposite side if there is not enough space.
scale
The default scale for this panel.
Declaration
[Tooltip("The default scale for this panel.")]
public string scale { get; set; }
Property Value
Type | Description |
---|---|
string |
theme
The default theme for this panel.
Declaration
[Tooltip("The default theme for this panel.")]
public string theme { get; set; }
Property Value
Type | Description |
---|---|
string |
tooltipContainer
The Tooltip layer container.
Declaration
public VisualElement tooltipContainer { get; }
Property Value
Type | Description |
---|---|
VisualElement |
tooltipDelayMs
The default tooltip delay in milliseconds for this panel.
Declaration
[Tooltip("The default tooltip delay in milliseconds for this panel.")]
public int tooltipDelayMs { get; set; }
Property Value
Type | Description |
---|---|
int |
Methods
FindNotificationLayer(VisualElement)
Utility method to quickly find the current application's Notification layer.
Declaration
public static VisualElement FindNotificationLayer(VisualElement element)
Parameters
Type | Name | Description |
---|---|---|
VisualElement | element | An element present in the application visual tree. |
Returns
Type | Description |
---|---|
VisualElement | The Notification layer container. |
FindPopupLayer(VisualElement)
Utility method to quickly find the current application's Popup layer.
Declaration
public static VisualElement FindPopupLayer(VisualElement element)
Parameters
Type | Name | Description |
---|---|---|
VisualElement | element | An element present in the application visual tree. |
Returns
Type | Description |
---|---|
VisualElement | The Popup layer container. |
FindTooltipLayer(VisualElement)
Utility method to quickly find the current application's Tooltip layer.
Declaration
public static VisualElement FindTooltipLayer(VisualElement element)
Parameters
Type | Name | Description |
---|---|---|
VisualElement | element | An element present in the application visual tree. |
Returns
Type | Description |
---|---|
VisualElement | The Tooltip layer container. |
GetLayoutDirectionUssClassName(Dir)
Declaration
public static string GetLayoutDirectionUssClassName(Dir enumValue)
Parameters
Type | Name | Description |
---|---|---|
Dir | enumValue |
Returns
Type | Description |
---|---|
string |