update UIElements

This commit is contained in:
何冠峰
2025-02-05 18:49:11 +08:00
parent 7e1dc7ef24
commit 4e6c146bde
7 changed files with 80 additions and 296 deletions
@@ -14,22 +14,17 @@ namespace YooAsset.Editor
/// <summary>
/// 单元列宽度
/// </summary>
public Length Width = 100f;
public Length Width;
/// <summary>
/// 单元列最小宽度
/// </summary>
public Length MinWidth = 30f;
public Length MinWidth;
/// <summary>
/// 单元列最大宽度
/// </summary>
public Length MaxWidth = MaxValue;
/// <summary>
/// 文本的锚点类型
/// </summary>
public TextAnchor TxtAnchor = TextAnchor.MiddleLeft;
public Length MaxWidth;
/// <summary>
/// 可伸缩
@@ -45,6 +40,25 @@ namespace YooAsset.Editor
/// 可排序
/// </summary>
public bool Sortable = false;
public ColumnStyle(Length width)
{
if (width.value > MaxValue)
width = MaxValue;
Width = width;
MinWidth = width;
MaxWidth = width;
}
public ColumnStyle(Length width, Length minWidth, Length maxWidth)
{
if (maxWidth.value > MaxValue)
maxWidth = MaxValue;
Width = width;
MinWidth = minWidth;
MaxWidth = maxWidth;
}
}
}
#endif