- 新增 XTableScrollbarFactory:横/竖滚动条的几何与外观全部来自样式参数 (thickness / margin=(起始端,终止端,侧边) / handle/padding / 两根的颜色与图片)。 竖条锚右上下对齐、横条锚下左右对齐;Sliding Area 沿轴 -T; 手柄两轴 -(T/2 + P)。生成物 DontSave|NotEditable(灰色)。 - 样式键进 DefaultTableStyles.xsss 与 StyleParams(含回退与动态补齐); RefreshView 里 SyncScrollbarStyle 只在值变化时重写,样式热更即生效。 - ScrollRect 内容(Viewport/Content)永远维护;m_AutoScrollTemplate 仅留序列化兼容。 AutoScrollbars 切换立即 Reconcile + Refresh + 重绘 Hierarchy/SceneView; 关闭时只回收我们生成的滚动条并清引用,用户自绑的原样保留。
84 lines
2.7 KiB
Plaintext
84 lines
2.7 KiB
Plaintext
// ==========================================
|
|
// Xeric UI Action Table - Default Style Sheet
|
|
// 表格默认样式定义
|
|
// ==========================================
|
|
|
|
|
|
namespace: xeric_table_default
|
|
|
|
cell/bg/color = (1,1,1,1):UnityEngine.Color @Desc:单元格背景颜色
|
|
|
|
cell/fg/color = (0.1,0.1,0.1,1):UnityEngine.Color @Desc:单元格前景文字颜色
|
|
|
|
cell/border/top/ {
|
|
color = (0.8,0.8,0.8,1):UnityEngine.Color @Desc:上边框颜色
|
|
width = 1:System.Single @Desc:上边框宽度
|
|
}
|
|
|
|
cell/border/bottom/ {
|
|
color = (0.8,0.8,0.8,1):UnityEngine.Color @Desc:下边框颜色
|
|
width = 1:System.Single @Desc:下边框宽度
|
|
}
|
|
|
|
cell/border/left/ {
|
|
color = (0.8,0.8,0.8,1):UnityEngine.Color @Desc:左边框颜色
|
|
width = 1:System.Single @Desc:左边框宽度
|
|
}
|
|
|
|
cell/border/right/ {
|
|
color = (0.8,0.8,0.8,1):UnityEngine.Color @Desc:右边框颜色
|
|
width = 1:System.Single @Desc:右边框宽度
|
|
}
|
|
|
|
cell/selection/bg/color = (0.2,0.5,1,0.3):UnityEngine.Color @Desc:选中单元格高亮颜色
|
|
|
|
header/bg/color = (0.9,0.9,0.9,1):UnityEngine.Color @Desc:表头背景颜色
|
|
|
|
header/fg/color = (0,0,0,1):UnityEngine.Color @Desc:表头文字颜色
|
|
|
|
cell/font/ {
|
|
size = 14:System.Int32 @Desc:默认字体大小
|
|
alignment = MiddleCenter:UnityEngine.TextAnchor @Desc:默认文本对齐
|
|
richText = true:System.Boolean @Desc:是否启用富文本
|
|
fontAsset = guid:68dace674a028544187e7ffe55cdae8b:TMPro.TMP_FontAsset @Desc:字体资源 @ResourceSoftReference:Packages/com.lrss3.xericuiactionvessel/Runtime/Font/SourceHanSansSC-Regular-2 SDF.asset
|
|
}
|
|
|
|
cell/default/ {
|
|
height = 40:System.Single @Desc:默认行高
|
|
width = 100:System.Single @Desc:默认列宽
|
|
}
|
|
|
|
scrollbar/ {
|
|
thickness = 8:System.Single @Desc:滚动条厚度(横条即高度)
|
|
margin = (0,0,4):UnityEngine.Vector3 @Desc:x=起始端边距 y=终止端边距 z=距父容器侧边
|
|
}
|
|
|
|
scrollbar/handle/ {
|
|
padding = 2:System.Single @Desc:手柄相对滑动区的内缩
|
|
color = (0.4,0.4,0.4,0.8):UnityEngine.Color @Desc:手柄颜色
|
|
# sprite = res:Sprites/ScrollbarHandle:UnityEngine.Sprite @Desc:手柄图片(可选)
|
|
}
|
|
|
|
scrollbar/bg/ {
|
|
color = (0.15,0.15,0.15,0.5):UnityEngine.Color @Desc:条背景颜色
|
|
# sprite = res:Sprites/ScrollbarTrack:UnityEngine.Sprite @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)
|
|
}
|