修复stylefield显示为红色字段的问题。

This commit is contained in:
2026-07-06 17:58:42 +08:00
parent b3db3b2b06
commit a6047062c6
15 changed files with 234 additions and 238 deletions
@@ -66,7 +66,6 @@ namespace XericUI.XTable.Rendering.Elements
RegisterField("/cell/font/size", OnStyleChanged);
RegisterField("/cell/font/alignment", OnStyleChanged);
RegisterField("/cell/font/richText", OnStyleChanged);
RegisterField("/cell/font/fontAsset", OnStyleChanged);
m_IsBound = true;
RefreshAll();
@@ -123,20 +122,6 @@ namespace XericUI.XTable.Rendering.Elements
StyleValue richVal = GetStyleValue("/cell/font/richText");
if (richVal != null && TextComponent != null)
TextComponent.richText = (bool)richVal;
// 字体资源
StyleValue fontVal = GetStyleValue("/cell/font/fontAsset");
if (fontVal != null && TextComponent != null)
{
try
{
TextComponent.font = fontVal.GetValueAs<TMP_FontAsset>();
}
catch
{
/* 类型不匹配时忽略 */
}
}
}
#endregion
@@ -47,3 +47,21 @@ cell/default/ {
height = 40:System.Single @Desc:默认行高
width = 100:System.Single @Desc:默认列宽
}
/button/TargetGraphic/ColorTint:UnityEngine.UI.ColorBlock/ {
.NormalColor = (1,1,1,1)
.HighlightedColor = (0.96,0.96,0.96,1)
.PressedColor = (0.78,0.78,0.78,1)
.SelectedColor = (0.96,0.96,0.96,1)
.DisabledColor = (0.6,0.6,0.6,0.8)
}
/toggle/TargetGraphic/ColorTint:UnityEngine.UI.ColorBlock/ {
.NormalColor = (1,1,1,1)
.HighlightedColor = (0.96,0.96,0.96,1)
.PressedColor = (0.78,0.78,0.78,1)
.SelectedColor = (0.96,0.96,0.96,1)
.DisabledColor = (0.6,0.6,0.6,0.8)
.DisabledColor = (0.6,0.6,0.6,0.8)
}