mirror of
https://github.com/Alex-Rachel/TEngine.git
synced 2025-08-14 16:51:28 +00:00
yoo2.2,9
yoo2.2,9
This commit is contained in:
@@ -8,6 +8,9 @@ namespace YooAsset.Editor
|
||||
{
|
||||
public static class UIElementsTools
|
||||
{
|
||||
/// <summary>
|
||||
/// 设置元素显隐
|
||||
/// </summary>
|
||||
public static void SetElementVisible(VisualElement element, bool visible)
|
||||
{
|
||||
if (element == null)
|
||||
@@ -16,6 +19,19 @@ namespace YooAsset.Editor
|
||||
element.style.display = visible ? DisplayStyle.Flex : DisplayStyle.None;
|
||||
element.style.visibility = visible ? Visibility.Visible : Visibility.Hidden;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 设置元素的文本最小宽度
|
||||
/// </summary>
|
||||
public static void SetElementLabelMinWidth(VisualElement element, int minWidth)
|
||||
{
|
||||
var label = element.Q<Label>();
|
||||
if (label != null)
|
||||
{
|
||||
// 设置最小宽度
|
||||
label.style.minWidth = minWidth;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
Reference in New Issue
Block a user