Files
XCEngine/docs/api/XCEditor/Foundation/UIEditorTheme/UIEditorTheme.md

45 lines
1.6 KiB
Markdown
Raw Normal View History

# UIEditorTheme
**命名空间**: `XCEngine::UI::Editor`
**类型**: `theme-accessor header`
**头文件**: `XCEditor/Foundation/UIEditorTheme.h`
**描述**: `XCEditor` 默认主题解析入口,向 `Collections / Fields / Shell` 各类控件暴露统一的 metrics 与 palette 访问函数。
## 概览
`UIEditorTheme.h` 当前不是“主题对象 + 可编辑主题树”,而是一组默认值解析函数。
这组函数把下游控件需要的 theme 数据集中暴露出来,包括:
- `Fields`
- bool / number / text / vector / enum / color / object / asset / property-grid
- `Collections`
- list-view / tree-view / scroll-view / tab-strip
- `Shell`
- menu-bar / menu-popup / status-bar / panel-frame / dock-host / viewport-slot / shell-compose / shell-interaction
## 当前实现行为
- `new_editor/src/Foundation/UIEditorTheme.cpp` 通过 `GetDefaultValue<T>()` + 一组宏生成所有 `ResolveUIEditor*` 默认访问器。
- 每个访问器当前都返回静态默认构造值,生命周期稳定,可安全被多处重复读取。
- 当前还没有:
- 主题资源加载
- runtime 主题切换
- 层叠式 style override
- 按 workspace / panel 定制局部 palette
## 当前调用链
- 多组 `tests/UI/Editor/integration/shell/*/main.cpp` 当前直接依赖这些默认 theme 访问器来构造演示场景。
- `Collections``Fields``Shell` 的控件页当前都把这里视为默认 metrics / palette 的公共来源。
## 相关文档
- [Foundation](../Foundation.md)
- [Fields](../../Fields/Fields.md)
- [Collections](../../Collections/Collections.md)
- [Shell](../../Shell/Shell.md)