docs: expand popup state API docs

This commit is contained in:
2026-04-03 13:36:57 +08:00
parent 30f6f527fa
commit 62e0d8b46d
5 changed files with 262 additions and 8 deletions

View File

@@ -12,19 +12,21 @@
`PopupState.h` 当前包含四类非常实用的 UI 状态辅助类型:
- `DeferredPopupState`
- `TargetedPopupState<T>`
- `TextInputPopupState<BufferCapacity>`
- `InlineTextEditState<ItemId, BufferCapacity>`
- [DeferredPopupState](DeferredPopupState.md)
- [TargetedPopupState<T>](TargetedPopupState.md)
- [TextInputPopupState<BufferCapacity>](TextInputPopupState.md)
- [InlineTextEditState<ItemId, BufferCapacity>](InlineTextEditState.md)
它们共同解决一个问题:把 ImGui 的即时模式弹窗交互变成可维护的状态机。
## 当前实现
- `DeferredPopupState` 负责“下一帧打开弹窗”
- `TargetedPopupState<T>` 在打开弹窗的同时绑定一个目标对象
- `TextInputPopupState` 内置固定容量字符缓冲区,适合创建目录等对话框
- `InlineTextEditState` 适合 Hierarchy 中的行内重命名
| 类型 | 作用 |
|------|------|
| [DeferredPopupState](DeferredPopupState.md) | 负责“下一帧打开弹窗”。 |
| [TargetedPopupState<T>](TargetedPopupState.md) | 在打开弹窗的同时绑定一个目标对象。 |
| [TextInputPopupState<BufferCapacity>](TextInputPopupState.md) | 内置固定容量字符缓冲区,适合轻量文本输入 popup。 |
| [InlineTextEditState<ItemId, BufferCapacity>](InlineTextEditState.md) | 适合 Hierarchy / Project 中的行内重命名。 |
## 设计说明
@@ -44,6 +46,10 @@
## 相关文档
- [UI](../UI.md)
- [DeferredPopupState](DeferredPopupState.md)
- [TargetedPopupState](TargetedPopupState.md)
- [TextInputPopupState](TextInputPopupState.md)
- [InlineTextEditState](InlineTextEditState.md)
- [ProjectActionRouter](../../Actions/ProjectActionRouter/ProjectActionRouter.md)
- [HierarchyActionRouter](../../Actions/HierarchyActionRouter/HierarchyActionRouter.md)
- [AboutEditorDialog](../AboutEditorDialog/AboutEditorDialog.md)