A game about forced loneliness, made by TACStudios
at master 1.3 kB view raw
1using UnityEngine.UIElements; 2 3namespace Unity.PlasticSCM.Editor 4{ 5 internal static class QueryVisualElementsExtensions 6 { 7 /// <summary> 8 /// Shows the element regardless if it is has been hidden or collapsed. 9 /// </summary> 10 /// <param name="query">The element query</param> 11 /// <typeparam name="T">The element type</typeparam> 12 internal static void Show<T>(this UQueryBuilder<T> query) 13 where T: VisualElement 14 { 15 ((T)query).Show(); 16 } 17 18 /// <summary> 19 /// Removes the element from the layout, freeing its space and position. 20 /// </summary> 21 /// <param name="query">The element query</param> 22 /// <typeparam name="T">The element type</typeparam> 23 internal static void Collapse<T>(this UQueryBuilder<T> query) 24 where T: VisualElement 25 { 26 ((T)query).Collapse(); 27 } 28 29 /// <summary> 30 /// Hides the element while preserving its space and position in the layout. 31 /// </summary> 32 /// <param name="query">The element query</param> 33 /// <typeparam name="T">The element type</typeparam> 34 internal static void Hide<T>(this UQueryBuilder<T> query) 35 where T: VisualElement 36 { 37 ((T)query).Collapse(); 38 } 39 } 40}