using UnityEngine.UIElements; namespace Unity.PlasticSCM.Editor { internal static class VisualElementExtensions { /// /// Shows the element regardless if it is has been hidden or collapsed. /// /// The element to show /// The element type internal static void Show(this T element) where T: VisualElement { element.RemoveFromClassList("collapse"); element.RemoveFromClassList("hide"); } /// /// Removes the element from the layout, freeing its space and position. /// /// The element to collapse /// The element type internal static void Collapse(this T element) where T: VisualElement { element.AddToClassList("collapse"); } /// /// Hides the element while preserving its space and position in the layout. /// /// The element to hide /// The element type internal static void Hide(this T element) where T: VisualElement { element.AddToClassList("hide"); } } }