arenos-nexus/Arenos Nexus/Library/PackageCache/com.unity.collab-proxy@ab839cc7d2ad/Editor/QueryVisualElementsExtensions.cs
Daniel 2e704cae70 init
Init Commit Unity
2025-09-25 22:01:28 +02:00

40 lines
1.3 KiB
C#

using UnityEngine.UIElements;
namespace Unity.PlasticSCM.Editor
{
internal static class QueryVisualElementsExtensions
{
/// <summary>
/// Shows the element regardless if it is has been hidden or collapsed.
/// </summary>
/// <param name="query">The element query</param>
/// <typeparam name="T">The element type</typeparam>
internal static void Show<T>(this UQueryBuilder<T> query)
where T: VisualElement
{
((T)query).Show();
}
/// <summary>
/// Removes the element from the layout, freeing its space and position.
/// </summary>
/// <param name="query">The element query</param>
/// <typeparam name="T">The element type</typeparam>
internal static void Collapse<T>(this UQueryBuilder<T> query)
where T: VisualElement
{
((T)query).Collapse();
}
/// <summary>
/// Hides the element while preserving its space and position in the layout.
/// </summary>
/// <param name="query">The element query</param>
/// <typeparam name="T">The element type</typeparam>
internal static void Hide<T>(this UQueryBuilder<T> query)
where T: VisualElement
{
((T)query).Collapse();
}
}
}