diff --git a/docs/plan/XCEditor_Dock统一与Tab拖拽停靠收口计划_2026-04-10.md b/docs/plan/XCEditor_Dock统一与Tab拖拽停靠收口计划_2026-04-10.md new file mode 100644 index 00000000..7f468bc1 --- /dev/null +++ b/docs/plan/XCEditor_Dock统一与Tab拖拽停靠收口计划_2026-04-10.md @@ -0,0 +1,364 @@ +# XCEditor Dock统一与Tab拖拽停靠收口计划 + +日期:`2026-04-10` + +## 1. 文档定位 + +这份计划只解决 `XCEditor` 当前 dock 基础层的两个核心问题: + +1. `Hierarchy / Inspector` 与 `Scene / Game / Console / Project` 顶部 chrome 不是同一套。 +2. tab 不能像旧 `editor/` 的 ImGui docking 那样拖拽重排与调整停靠位置。 + +这两个问题本质上是同一个根问题:当前 `DockHost` 的叶子语义和渲染路径没有统一,导致视觉、命中、交互、布局变更都被拆成两套,后续再堆业务面板只会继续在错误基础上加复杂度。 + +本计划属于 `Editor` 基础层收口,不属于业务面板重建计划。 +在这份计划完成前,不继续推进 `new_editor` 的 `Project / Hierarchy / Inspector / Console` 业务重建。 + +## 2. 当前问题与根因 + +## 2.1 当前现象 + +- `Hierarchy / Inspector` 的 header 仍然走 standalone panel 外壳。 +- `Scene / Game / Console / Project` 走 tab stack 外壳。 +- 用户看到的直接结果是:tab 高度、内边距、标题区结构、可交互区域都不一致。 +- 用户尝试拖 tab 时,没有任何重排、合并、分裂停靠反馈。 + +## 2.2 当前真实根因 + +当前实现里同时存在两种叶子形态: + +- `Panel` +- `TabStack` + +这使得 `DockHost` 的整条链路都被拆成两套: + +- 布局输出分叉 +- 绘制分叉 +- hit test 分叉 +- 交互分叉 +- 未来的 docking mutation 也无从统一落点 + +当前代码里的直接证据: + +- `new_editor/app/Shell/ProductShellAsset.cpp` +- `new_editor/include/XCEditor/Shell/UIEditorDockHost.h` +- `new_editor/src/Shell/UIEditorDockHost.cpp` +- `new_editor/include/XCEditor/Shell/UIEditorDockHostInteraction.h` +- `new_editor/src/Shell/UIEditorDockHostInteraction.cpp` +- `new_editor/include/XCEditor/Collections/UIEditorTabStripInteraction.h` +- `new_editor/src/Collections/UIEditorTabStripInteraction.cpp` +- `new_editor/include/XCEditor/Shell/UIEditorWorkspaceController.h` +- `new_editor/src/Shell/UIEditorWorkspaceController.cpp` +- `new_editor/src/Shell/UIEditorWorkspaceLayoutPersistence.cpp` + +当前控制器层只具备: + +- `OpenPanel` +- `ClosePanel` +- `ShowPanel` +- `HidePanel` +- `ActivatePanel` +- `ResetWorkspace` +- `SetSplitRatio` + +还没有真正支撑 docking 的命令与树变更能力: + +- `ReorderTab` +- `MoveTabToStack` +- `DockTabRelative` +- `ExtractTab` +- `MergeTabStack` + +## 3. 改造目标 + +本轮收口后的目标状态如下: + +1. 运行态叶子节点只保留一种语义:`TabStack`。 +2. 单面板也被视为“只有一个 tab 的 tab stack”。 +3. `DockHost` 只保留一套统一的 `DockHeader / TabWell / ContentBody` 视觉结构。 +4. `Hierarchy / Inspector` 与 `Scene / Game / Console / Project` 必须走同一套 header/tab primitive。 +5. tab 至少支持: + - 同 stack 重排 + - 跨 stack 合并 + - 向目标 leaf 的 `left/right/top/bottom/center` 停靠 +6. 拖拽过程中必须有明确 preview,不允许“拖了但没有反馈”。 +7. workspace 布局持久化必须覆盖新结构,并兼容旧布局升级。 +8. 在 `tests/UI/Editor` 中补齐单元测试与集成测试后,才允许继续推进业务面板。 + +## 4. 范围边界 + +## 4.1 本轮必须做 + +- `XCEditor` 的 dock 叶子语义统一 +- dock chrome 统一 +- tab 拖拽状态机 +- docking drop target 与 preview overlay +- workspace tree surgery +- layout persistence 升级 +- `tests/UI/Editor` 的回归补齐 + +## 4.2 本轮明确不做 + +- 多原生窗口 detached docking +- 浮动窗口系统 +- 业务面板内部复杂逻辑重建 +- `Runtime UI` 相关能力 +- 为 `Editor` 再做一套资源化主题体系 + +`Editor` 当前继续采用固定代码样式,不走 UI 资源那套。 + +## 5. 目标结构 + +## 5.1 统一后的 workspace 叶子模型 + +运行态只保留: + +- `SplitNode` +- `TabStackNode` + +其中 `TabStackNode` 内部包含: + +- `tabs` +- `selectedTabId` +- `activePanelId` + +不再保留“裸 `Panel` 叶子节点”这种视觉语义。 + +## 5.2 统一后的 dock 布局输出 + +`DockHost` 最终应面向统一 leaf 输出: + +- `tabWellRect` +- `contentBodyRect` +- `selectedPanelId` +- `tabItems` +- `dropPreview` + +不再分成: + +- `panelLayouts` +- `tabStackLayouts` + +两套平行分支。 + +## 5.3 统一后的交互分层 + +交互链路收口为: + +1. `UIEditorTabStripInteraction` + - 负责 tab press / armed / drag / release / cancel +2. `UIEditorDockHostInteraction` + - 负责把 tab 拖拽映射为 docking preview 与 docking command +3. `UIEditorWorkspaceController` + - 负责真正修改 workspace tree +4. `UIEditorWorkspaceLayoutPersistence` + - 负责新旧布局读写与升级 + +## 6. 分阶段执行计划 + +## Phase A:统一叶子语义 + +### 目标 + +把 workspace 运行态的叶子语义统一到 `TabStackNode`,彻底消除 standalone panel 叶子。 + +### 任务 + +- 调整 `UIEditorWorkspaceModel`,明确叶子节点只允许 `TabStackNode`。 +- 调整 `ProductShellAsset` 与默认 workspace 构建逻辑,让单面板默认也生成单-tab stack。 +- 调整 `UIEditorWorkspaceSession`,保证 active/selected 状态都围绕 tab stack 工作。 +- 调整 `UIEditorWorkspaceLayoutPersistence`,读旧格式时自动升级为统一 leaf 结构。 +- 增加 degenerate tree cleanup: + - 空 stack 删除 + - 单子 split 折叠 + - 非法 selectedTab 修正 + +### 完成标准 + +- 运行态 workspace 中不再出现 standalone panel 叶子。 +- 旧布局能被自动升级并正常显示。 + +## Phase B:统一 dock chrome 与布局输出 + +### 目标 + +让所有 panel 顶部都走同一套 dock header / tab well primitive。 + +### 任务 + +- 重构 `UIEditorDockHost` 的 layout 输出结构,改为统一 leaf 布局。 +- 删除 standalone panel 与 tab stack 的渲染分叉。 +- `UIEditorPanelFrame` 缩回“边框与 body 外壳”职责,不再自带独立 header 风格。 +- `UIEditorTabStrip` 成为唯一 tab/header 渲染入口。 +- `UIEditorPanelContentHost` 只根据统一 leaf layout 定位 panel body。 +- 统一 hit target 语义,保证 header/tab/body 命中都来自同一套结构。 + +### 完成标准 + +- `Hierarchy / Inspector / Scene / Game / Console / Project` 顶部结构完全统一。 +- tab 高度、padding、命中区域、激活态样式只由一套 metric/palette 控制。 + +## Phase C:同 stack tab 拖拽重排 + +### 目标 + +先把最小闭环做稳:同一个 stack 内 tab 可拖拽重排。 + +### 任务 + +- 在 `UIEditorTabStripInteraction` 增加拖拽状态机: + - `pressed` + - `armed` + - `dragging` + - `cancelled` + - `committed` +- 增加 drag threshold、pointer capture、Esc cancel、release commit。 +- 在同 stack 内计算插入位置与 preview insertion marker。 +- 在 `UIEditorWorkspaceController` 增加 `ReorderTab(...)`。 +- 保证 selected/active/focus 状态在重排后仍然正确。 + +### 完成标准 + +- 同一 tab strip 内可拖拽重排。 +- 有明确插入线 preview。 +- 无闪烁、无丢焦、无错误激活。 + +## Phase D:跨 stack 合并与 split docking + +### 目标 + +把 tab 从“只能在本组重排”扩展到“可跨组移动并形成新停靠布局”。 + +### 任务 + +- 在 `DockHostInteraction` 中引入 drop target 解析: + - `center` + - `left` + - `right` + - `top` + - `bottom` + - `root empty area` +- 增加 preview overlay: + - center merge 预览 + - edge split 高亮预览 + - 同 stack reorder 线性预览 +- 在 `WorkspaceController` 中增加: + - `MoveTabToStack(...)` + - `DockTabRelative(...)` + - `ExtractTab(...)` + - `MergeTabStack(...)` +- 增加 tree surgery: + - 从源 stack 抽 tab + - 插入目标 stack + - 围绕目标 leaf 生成 split + - 空 stack 清理 + - 单子 split 折叠 + +### 完成标准 + +- tab 可从一个 stack 拖到另一个 stack。 +- 可通过 `left/right/top/bottom/center` 形成新布局。 +- 交互有实时 preview。 + +## Phase E:持久化、回归与测试体系补齐 + +### 目标 + +把新 docking 结构正式纳入 `tests/UI/Editor` 的标准回归。 + +### 任务 + +- 更新 layout serialization,稳定写回统一 leaf 结构。 +- 旧布局读取时自动升级。 +- 补齐 `tests/UI/Editor/unit`: + - 旧布局升级 + - 同 stack reorder + - 跨 stack merge + - split docking + - cleanup collapse + - active/selected 同步 + - persistence round-trip +- 补齐 `tests/UI/Editor/integration`: + - `shell/dock_header_unified` + - `shell/dock_tab_reorder_same_stack` + - `shell/dock_tab_move_between_stacks` + - `shell/dock_tab_split_targets` + - `state/dock_layout_persistence` +- 每个集成测试 exe 顶部写清楚当前验证目标,不再只写模糊状态文本。 + +### 完成标准 + +- `tests/UI/Editor` 对新 docking 具备完整回归入口。 +- 后续业务面板接入时,不需要再倒回头修基础 docking 架构。 + +## 7. 代码落点 + +本轮预计主要改动路径: + +- `new_editor/include/XCEditor/Shell/UIEditorWorkspaceModel.h` +- `new_editor/src/Shell/UIEditorWorkspaceModel.cpp` +- `new_editor/include/XCEditor/Shell/UIEditorWorkspaceController.h` +- `new_editor/src/Shell/UIEditorWorkspaceController.cpp` +- `new_editor/include/XCEditor/Shell/UIEditorWorkspaceLayoutPersistence.h` +- `new_editor/src/Shell/UIEditorWorkspaceLayoutPersistence.cpp` +- `new_editor/include/XCEditor/Shell/UIEditorWorkspaceSession.h` +- `new_editor/src/Shell/UIEditorWorkspaceSession.cpp` +- `new_editor/include/XCEditor/Shell/UIEditorDockHost.h` +- `new_editor/src/Shell/UIEditorDockHost.cpp` +- `new_editor/include/XCEditor/Shell/UIEditorDockHostInteraction.h` +- `new_editor/src/Shell/UIEditorDockHostInteraction.cpp` +- `new_editor/include/XCEditor/Collections/UIEditorTabStripInteraction.h` +- `new_editor/src/Collections/UIEditorTabStripInteraction.cpp` +- `new_editor/include/XCEditor/Shell/UIEditorPanelFrame.h` +- `new_editor/src/Shell/UIEditorPanelFrame.cpp` +- `new_editor/include/XCEditor/Shell/UIEditorPanelContentHost.h` +- `new_editor/src/Shell/UIEditorPanelContentHost.cpp` +- `new_editor/app/Shell/ProductShellAsset.cpp` +- `tests/UI/Editor/unit/*dock*` +- `tests/UI/Editor/unit/*workspace*` +- `tests/UI/Editor/integration/shell/*dock*` +- `tests/UI/Editor/integration/state/layout_persistence/*` + +## 8. 并行拆分建议 + +这轮改造可以拆成 4 条可并行子线,但必须按主从顺序集成: + +1. `WorkspaceModel / Controller / Persistence` +2. `DockHost layout / render / hit-test 统一` +3. `TabStripInteraction / DockHostInteraction` 拖拽状态机 +4. `tests/UI/Editor` 单元与集成回归补齐 + +并行原则: + +- 先以 `Phase A` 的统一 leaf 语义为总前提。 +- `Phase B` 与 `Phase C` 可以在统一模型落定后并行推进。 +- `Phase E` 可以在 `Phase C / D` 功能接口稳定后并行补齐。 + +## 9. 风险与控制 + +## 9.1 最大风险 + +- 旧布局兼容被打断 +- 统一叶子后现有 panel body 定位错位 +- 拖拽状态机与 focus/capture 冲突 +- split tree surgery 产生退化树或悬空 active panel + +## 9.2 控制方式 + +- 先做模型统一,再做交互,不反过来堆补丁 +- 每个 mutation 先补 `unit` 再补 `integration` +- 任何旧布局兼容问题都在 persistence 层处理,不在渲染层写兼容分叉 +- 任何单面板特殊视觉都回收为单-tab stack,不再恢复 standalone panel 路径 + +## 10. 收口判定 + +只有同时满足以下条件,才算这轮 dock 基础层真正收口: + +1. 所有 dock 叶子统一为 `TabStackNode`。 +2. `Hierarchy / Inspector` 与 `Scene / Game / Console / Project` 头部视觉完全统一。 +3. tab 可同组重排、跨组合并、左右上下停靠。 +4. 拖拽过程有稳定 preview,释放后结果正确。 +5. 布局可持久化,旧布局可升级。 +6. `tests/UI/Editor/unit + integration` 已覆盖关键回归。 + +在这 6 条完成前,不进入下一轮业务面板重建。 diff --git a/new_editor/app/Shell/ProductShellAsset.cpp b/new_editor/app/Shell/ProductShellAsset.cpp index 4d09ff81..08404ba4 100644 --- a/new_editor/app/Shell/ProductShellAsset.cpp +++ b/new_editor/app/Shell/ProductShellAsset.cpp @@ -442,12 +442,7 @@ UIEditorShellInteractionDefinition BuildBaseShellDefinition() { BuildToolbarButton("run.pause", UIEditorShellToolbarGlyph::Pause), BuildToolbarButton("run.step", UIEditorShellToolbarGlyph::Step) }; - definition.statusSegments = { - BuildStatusSegment("editor-mode", "Edit", UIEditorStatusBarSlot::Leading, UIEditorStatusBarTextTone::Primary, 84.0f, true), - BuildStatusSegment("editor-status", "Shell ready", UIEditorStatusBarSlot::Leading, UIEditorStatusBarTextTone::Muted, 192.0f, false), - BuildStatusSegment("capture", "F12 -> Screenshot", UIEditorStatusBarSlot::Trailing, UIEditorStatusBarTextTone::Muted, 168.0f, false), - BuildStatusSegment("active-panel", "Scene", UIEditorStatusBarSlot::Trailing, UIEditorStatusBarTextTone::Primary, 136.0f, true) - }; + definition.statusSegments = {}; definition.workspacePresentations = { BuildPlaceholderPresentation("hierarchy"), BuildViewportPresentation("scene", "Scene", "Perspective", "Viewport shell ready"), diff --git a/new_editor/include/XCEditor/Collections/UIEditorTabStrip.h b/new_editor/include/XCEditor/Collections/UIEditorTabStrip.h index 58a9aa46..18dc94ed 100644 --- a/new_editor/include/XCEditor/Collections/UIEditorTabStrip.h +++ b/new_editor/include/XCEditor/Collections/UIEditorTabStrip.h @@ -31,56 +31,56 @@ struct UIEditorTabStripState { struct UIEditorTabStripMetrics { ::XCEngine::UI::Layout::UITabStripMetrics layoutMetrics = - ::XCEngine::UI::Layout::UITabStripMetrics{ 32.0f, 88.0f, 12.0f, 1.0f }; - float estimatedGlyphWidth = 7.0f; - float closeButtonExtent = 14.0f; - float closeButtonGap = 8.0f; - float closeInsetRight = 12.0f; + ::XCEngine::UI::Layout::UITabStripMetrics{ 22.0f, 68.0f, 8.0f, 1.0f }; + float estimatedGlyphWidth = 6.0f; + float closeButtonExtent = 10.0f; + float closeButtonGap = 4.0f; + float closeInsetRight = 6.0f; float closeInsetY = 0.0f; - float labelInsetX = 12.0f; - float labelInsetY = -1.0f; + float labelInsetX = 8.0f; + float labelInsetY = -2.5f; float baseBorderThickness = 1.0f; - float selectedBorderThickness = 1.5f; - float focusedBorderThickness = 2.0f; + float selectedBorderThickness = 1.0f; + float focusedBorderThickness = 1.0f; }; struct UIEditorTabStripPalette { ::XCEngine::UI::UIColor stripBackgroundColor = - ::XCEngine::UI::UIColor(0.15f, 0.15f, 0.16f, 1.0f); + ::XCEngine::UI::UIColor(0.16f, 0.16f, 0.16f, 1.0f); ::XCEngine::UI::UIColor headerBackgroundColor = - ::XCEngine::UI::UIColor(0.18f, 0.18f, 0.19f, 1.0f); + ::XCEngine::UI::UIColor(0.18f, 0.18f, 0.18f, 1.0f); ::XCEngine::UI::UIColor contentBackgroundColor = - ::XCEngine::UI::UIColor(0.15f, 0.15f, 0.16f, 1.0f); + ::XCEngine::UI::UIColor(0.17f, 0.17f, 0.17f, 1.0f); ::XCEngine::UI::UIColor stripBorderColor = - ::XCEngine::UI::UIColor(0.30f, 0.32f, 0.34f, 1.0f); + ::XCEngine::UI::UIColor(0.24f, 0.24f, 0.24f, 1.0f); ::XCEngine::UI::UIColor focusedBorderColor = - ::XCEngine::UI::UIColor(0.78f, 0.80f, 0.84f, 1.0f); + ::XCEngine::UI::UIColor(0.36f, 0.36f, 0.36f, 1.0f); ::XCEngine::UI::UIColor tabColor = - ::XCEngine::UI::UIColor(0.21f, 0.22f, 0.24f, 1.0f); + ::XCEngine::UI::UIColor(0.20f, 0.20f, 0.20f, 1.0f); ::XCEngine::UI::UIColor tabHoveredColor = - ::XCEngine::UI::UIColor(0.27f, 0.28f, 0.30f, 1.0f); + ::XCEngine::UI::UIColor(0.23f, 0.23f, 0.23f, 1.0f); ::XCEngine::UI::UIColor tabSelectedColor = - ::XCEngine::UI::UIColor(0.33f, 0.35f, 0.38f, 1.0f); + ::XCEngine::UI::UIColor(0.22f, 0.22f, 0.22f, 1.0f); ::XCEngine::UI::UIColor tabBorderColor = - ::XCEngine::UI::UIColor(0.32f, 0.34f, 0.36f, 1.0f); + ::XCEngine::UI::UIColor(0.24f, 0.24f, 0.24f, 1.0f); ::XCEngine::UI::UIColor tabHoveredBorderColor = - ::XCEngine::UI::UIColor(0.42f, 0.44f, 0.47f, 1.0f); + ::XCEngine::UI::UIColor(0.31f, 0.31f, 0.31f, 1.0f); ::XCEngine::UI::UIColor tabSelectedBorderColor = - ::XCEngine::UI::UIColor(0.50f, 0.52f, 0.56f, 1.0f); + ::XCEngine::UI::UIColor(0.34f, 0.34f, 0.34f, 1.0f); ::XCEngine::UI::UIColor textPrimary = - ::XCEngine::UI::UIColor(0.93f, 0.94f, 0.96f, 1.0f); + ::XCEngine::UI::UIColor(0.86f, 0.86f, 0.86f, 1.0f); ::XCEngine::UI::UIColor textSecondary = - ::XCEngine::UI::UIColor(0.70f, 0.72f, 0.74f, 1.0f); + ::XCEngine::UI::UIColor(0.67f, 0.67f, 0.67f, 1.0f); ::XCEngine::UI::UIColor textMuted = - ::XCEngine::UI::UIColor(0.58f, 0.59f, 0.62f, 1.0f); + ::XCEngine::UI::UIColor(0.58f, 0.58f, 0.58f, 1.0f); ::XCEngine::UI::UIColor closeButtonColor = - ::XCEngine::UI::UIColor(0.21f, 0.22f, 0.24f, 1.0f); + ::XCEngine::UI::UIColor(0.20f, 0.20f, 0.20f, 1.0f); ::XCEngine::UI::UIColor closeButtonHoveredColor = - ::XCEngine::UI::UIColor(0.27f, 0.28f, 0.30f, 1.0f); + ::XCEngine::UI::UIColor(0.25f, 0.25f, 0.25f, 1.0f); ::XCEngine::UI::UIColor closeButtonBorderColor = - ::XCEngine::UI::UIColor(0.42f, 0.44f, 0.47f, 1.0f); + ::XCEngine::UI::UIColor(0.30f, 0.30f, 0.30f, 1.0f); ::XCEngine::UI::UIColor closeGlyphColor = - ::XCEngine::UI::UIColor(0.93f, 0.94f, 0.96f, 1.0f); + ::XCEngine::UI::UIColor(0.83f, 0.83f, 0.83f, 1.0f); }; struct UIEditorTabStripLayout { diff --git a/new_editor/include/XCEditor/Shell/UIEditorDockHost.h b/new_editor/include/XCEditor/Shell/UIEditorDockHost.h index ec09c054..e8c2a87e 100644 --- a/new_editor/include/XCEditor/Shell/UIEditorDockHost.h +++ b/new_editor/include/XCEditor/Shell/UIEditorDockHost.h @@ -49,14 +49,14 @@ struct UIEditorDockHostState { struct UIEditorDockHostMetrics { ::XCEngine::UI::Layout::UISplitterMetrics splitterMetrics = - ::XCEngine::UI::Layout::UISplitterMetrics{ 10.0f, 18.0f }; + ::XCEngine::UI::Layout::UISplitterMetrics{ 4.0f, 12.0f }; UIEditorTabStripMetrics tabStripMetrics = {}; UIEditorPanelFrameMetrics panelFrameMetrics = {}; ::XCEngine::UI::UISize minimumStandalonePanelBodySize = ::XCEngine::UI::UISize(180.0f, 140.0f); ::XCEngine::UI::UISize minimumTabContentBodySize = ::XCEngine::UI::UISize(260.0f, 180.0f); - float splitterHandleRounding = 4.0f; + float splitterHandleRounding = 0.0f; float placeholderLineGap = 22.0f; }; @@ -64,11 +64,11 @@ struct UIEditorDockHostPalette { UIEditorTabStripPalette tabStripPalette = {}; UIEditorPanelFramePalette panelFramePalette = {}; ::XCEngine::UI::UIColor splitterColor = - ::XCEngine::UI::UIColor(0.22f, 0.23f, 0.25f, 1.0f); + ::XCEngine::UI::UIColor(0.22f, 0.22f, 0.22f, 1.0f); ::XCEngine::UI::UIColor splitterHoveredColor = - ::XCEngine::UI::UIColor(0.32f, 0.34f, 0.36f, 1.0f); + ::XCEngine::UI::UIColor(0.29f, 0.29f, 0.29f, 1.0f); ::XCEngine::UI::UIColor splitterActiveColor = - ::XCEngine::UI::UIColor(0.50f, 0.52f, 0.56f, 1.0f); + ::XCEngine::UI::UIColor(0.35f, 0.35f, 0.35f, 1.0f); ::XCEngine::UI::UIColor placeholderTitleColor = ::XCEngine::UI::UIColor(0.93f, 0.94f, 0.96f, 1.0f); ::XCEngine::UI::UIColor placeholderTextColor = diff --git a/new_editor/include/XCEditor/Shell/UIEditorMenuBar.h b/new_editor/include/XCEditor/Shell/UIEditorMenuBar.h index 8d175ce6..80919d54 100644 --- a/new_editor/include/XCEditor/Shell/UIEditorMenuBar.h +++ b/new_editor/include/XCEditor/Shell/UIEditorMenuBar.h @@ -26,41 +26,41 @@ struct UIEditorMenuBarState { }; struct UIEditorMenuBarMetrics { - float barHeight = 34.0f; - float horizontalInset = 10.0f; - float verticalInset = 4.0f; - float buttonGap = 6.0f; - float buttonPaddingX = 14.0f; - float estimatedGlyphWidth = 7.0f; - float labelInsetY = -1.0f; - float barCornerRounding = 8.0f; - float buttonCornerRounding = 6.0f; + float barHeight = 24.0f; + float horizontalInset = 0.0f; + float verticalInset = 2.0f; + float buttonGap = 2.0f; + float buttonPaddingX = 10.0f; + float estimatedGlyphWidth = 6.5f; + float labelInsetY = -1.5f; + float barCornerRounding = 0.0f; + float buttonCornerRounding = 0.0f; float baseBorderThickness = 1.0f; - float focusedBorderThickness = 2.0f; - float openBorderThickness = 1.5f; + float focusedBorderThickness = 1.0f; + float openBorderThickness = 1.0f; }; struct UIEditorMenuBarPalette { ::XCEngine::UI::UIColor barColor = - ::XCEngine::UI::UIColor(0.18f, 0.18f, 0.19f, 1.0f); + ::XCEngine::UI::UIColor(0.14f, 0.14f, 0.14f, 1.0f); ::XCEngine::UI::UIColor buttonColor = - ::XCEngine::UI::UIColor(0.21f, 0.22f, 0.24f, 1.0f); + ::XCEngine::UI::UIColor(0.18f, 0.18f, 0.18f, 1.0f); ::XCEngine::UI::UIColor buttonHoveredColor = - ::XCEngine::UI::UIColor(0.27f, 0.28f, 0.30f, 1.0f); + ::XCEngine::UI::UIColor(0.23f, 0.23f, 0.23f, 1.0f); ::XCEngine::UI::UIColor buttonOpenColor = - ::XCEngine::UI::UIColor(0.33f, 0.35f, 0.38f, 1.0f); + ::XCEngine::UI::UIColor(0.28f, 0.28f, 0.28f, 1.0f); ::XCEngine::UI::UIColor borderColor = - ::XCEngine::UI::UIColor(0.30f, 0.32f, 0.34f, 1.0f); + ::XCEngine::UI::UIColor(0.24f, 0.24f, 0.24f, 1.0f); ::XCEngine::UI::UIColor focusedBorderColor = - ::XCEngine::UI::UIColor(0.78f, 0.80f, 0.84f, 1.0f); + ::XCEngine::UI::UIColor(0.38f, 0.38f, 0.38f, 1.0f); ::XCEngine::UI::UIColor openBorderColor = - ::XCEngine::UI::UIColor(0.50f, 0.52f, 0.56f, 1.0f); + ::XCEngine::UI::UIColor(0.34f, 0.34f, 0.34f, 1.0f); ::XCEngine::UI::UIColor textPrimary = - ::XCEngine::UI::UIColor(0.93f, 0.94f, 0.96f, 1.0f); + ::XCEngine::UI::UIColor(0.85f, 0.85f, 0.85f, 1.0f); ::XCEngine::UI::UIColor textMuted = - ::XCEngine::UI::UIColor(0.70f, 0.72f, 0.74f, 1.0f); + ::XCEngine::UI::UIColor(0.67f, 0.67f, 0.67f, 1.0f); ::XCEngine::UI::UIColor textDisabled = - ::XCEngine::UI::UIColor(0.54f, 0.55f, 0.58f, 1.0f); + ::XCEngine::UI::UIColor(0.50f, 0.50f, 0.50f, 1.0f); }; struct UIEditorMenuBarLayout { diff --git a/new_editor/include/XCEditor/Shell/UIEditorPanelFrame.h b/new_editor/include/XCEditor/Shell/UIEditorPanelFrame.h index 975955a8..ca9c4fe9 100644 --- a/new_editor/include/XCEditor/Shell/UIEditorPanelFrame.h +++ b/new_editor/include/XCEditor/Shell/UIEditorPanelFrame.h @@ -41,55 +41,55 @@ struct UIEditorPanelFrameText { }; struct UIEditorPanelFrameMetrics { - float cornerRounding = 8.0f; - float headerHeight = 36.0f; - float footerHeight = 24.0f; - float contentPadding = 12.0f; - float titleInsetX = 14.0f; - float titleInsetY = 9.0f; - float subtitleInsetY = 22.0f; - float footerInsetX = 14.0f; - float footerInsetY = 6.0f; - float actionButtonExtent = 18.0f; - float actionInsetX = 12.0f; - float actionGap = 6.0f; + float cornerRounding = 0.0f; + float headerHeight = 28.0f; + float footerHeight = 18.0f; + float contentPadding = 8.0f; + float titleInsetX = 9.0f; + float titleInsetY = 6.0f; + float subtitleInsetY = 16.0f; + float footerInsetX = 9.0f; + float footerInsetY = 3.0f; + float actionButtonExtent = 14.0f; + float actionInsetX = 8.0f; + float actionGap = 4.0f; float baseBorderThickness = 1.0f; - float hoveredBorderThickness = 1.25f; - float activeBorderThickness = 1.5f; - float focusedBorderThickness = 2.0f; + float hoveredBorderThickness = 1.0f; + float activeBorderThickness = 1.0f; + float focusedBorderThickness = 1.0f; }; struct UIEditorPanelFramePalette { ::XCEngine::UI::UIColor surfaceColor = - ::XCEngine::UI::UIColor(0.15f, 0.15f, 0.16f, 1.0f); + ::XCEngine::UI::UIColor(0.18f, 0.18f, 0.18f, 1.0f); ::XCEngine::UI::UIColor headerColor = - ::XCEngine::UI::UIColor(0.18f, 0.18f, 0.19f, 1.0f); + ::XCEngine::UI::UIColor(0.20f, 0.20f, 0.20f, 1.0f); ::XCEngine::UI::UIColor footerColor = - ::XCEngine::UI::UIColor(0.17f, 0.17f, 0.18f, 1.0f); + ::XCEngine::UI::UIColor(0.18f, 0.18f, 0.18f, 1.0f); ::XCEngine::UI::UIColor borderColor = - ::XCEngine::UI::UIColor(0.30f, 0.32f, 0.34f, 1.0f); + ::XCEngine::UI::UIColor(0.23f, 0.23f, 0.23f, 1.0f); ::XCEngine::UI::UIColor hoveredBorderColor = - ::XCEngine::UI::UIColor(0.39f, 0.41f, 0.43f, 1.0f); + ::XCEngine::UI::UIColor(0.28f, 0.28f, 0.28f, 1.0f); ::XCEngine::UI::UIColor activeBorderColor = - ::XCEngine::UI::UIColor(0.50f, 0.52f, 0.56f, 1.0f); + ::XCEngine::UI::UIColor(0.32f, 0.32f, 0.32f, 1.0f); ::XCEngine::UI::UIColor focusedBorderColor = - ::XCEngine::UI::UIColor(0.78f, 0.80f, 0.84f, 1.0f); + ::XCEngine::UI::UIColor(0.36f, 0.36f, 0.36f, 1.0f); ::XCEngine::UI::UIColor textPrimary = - ::XCEngine::UI::UIColor(0.93f, 0.94f, 0.96f, 1.0f); + ::XCEngine::UI::UIColor(0.86f, 0.86f, 0.86f, 1.0f); ::XCEngine::UI::UIColor textSecondary = - ::XCEngine::UI::UIColor(0.70f, 0.72f, 0.74f, 1.0f); + ::XCEngine::UI::UIColor(0.64f, 0.64f, 0.64f, 1.0f); ::XCEngine::UI::UIColor textMuted = - ::XCEngine::UI::UIColor(0.58f, 0.59f, 0.62f, 1.0f); + ::XCEngine::UI::UIColor(0.58f, 0.58f, 0.58f, 1.0f); ::XCEngine::UI::UIColor actionButtonColor = - ::XCEngine::UI::UIColor(0.21f, 0.22f, 0.24f, 1.0f); + ::XCEngine::UI::UIColor(0.21f, 0.21f, 0.21f, 1.0f); ::XCEngine::UI::UIColor actionButtonHoveredColor = - ::XCEngine::UI::UIColor(0.27f, 0.28f, 0.30f, 1.0f); + ::XCEngine::UI::UIColor(0.24f, 0.24f, 0.24f, 1.0f); ::XCEngine::UI::UIColor actionButtonSelectedColor = - ::XCEngine::UI::UIColor(0.33f, 0.35f, 0.38f, 1.0f); + ::XCEngine::UI::UIColor(0.27f, 0.27f, 0.27f, 1.0f); ::XCEngine::UI::UIColor actionButtonBorderColor = - ::XCEngine::UI::UIColor(0.42f, 0.44f, 0.47f, 1.0f); + ::XCEngine::UI::UIColor(0.29f, 0.29f, 0.29f, 1.0f); ::XCEngine::UI::UIColor actionGlyphColor = - ::XCEngine::UI::UIColor(0.93f, 0.94f, 0.96f, 1.0f); + ::XCEngine::UI::UIColor(0.82f, 0.82f, 0.82f, 1.0f); }; struct UIEditorPanelFrameLayout { diff --git a/new_editor/include/XCEditor/Shell/UIEditorShellCompose.h b/new_editor/include/XCEditor/Shell/UIEditorShellCompose.h index 477e5f8b..dba5b00d 100644 --- a/new_editor/include/XCEditor/Shell/UIEditorShellCompose.h +++ b/new_editor/include/XCEditor/Shell/UIEditorShellCompose.h @@ -26,30 +26,30 @@ struct UIEditorShellToolbarLayout { struct UIEditorShellToolbarMetrics { float barHeight = 24.0f; - float groupPaddingX = 8.0f; - float groupPaddingY = 3.0f; - float buttonWidth = 20.0f; - float buttonHeight = 18.0f; - float buttonGap = 5.0f; - float groupCornerRounding = 6.0f; - float buttonCornerRounding = 4.0f; + float groupPaddingX = 6.0f; + float groupPaddingY = 2.0f; + float buttonWidth = 18.0f; + float buttonHeight = 16.0f; + float buttonGap = 4.0f; + float groupCornerRounding = 0.0f; + float buttonCornerRounding = 0.0f; float borderThickness = 1.0f; - float iconThickness = 1.35f; + float iconThickness = 1.2f; }; struct UIEditorShellToolbarPalette { ::XCEngine::UI::UIColor barColor = ::XCEngine::UI::UIColor(0.13f, 0.13f, 0.13f, 1.0f); ::XCEngine::UI::UIColor groupColor = - ::XCEngine::UI::UIColor(0.16f, 0.16f, 0.16f, 1.0f); + ::XCEngine::UI::UIColor(0.15f, 0.15f, 0.15f, 1.0f); ::XCEngine::UI::UIColor groupBorderColor = - ::XCEngine::UI::UIColor(0.30f, 0.30f, 0.30f, 1.0f); + ::XCEngine::UI::UIColor(0.25f, 0.25f, 0.25f, 1.0f); ::XCEngine::UI::UIColor buttonColor = - ::XCEngine::UI::UIColor(0.20f, 0.20f, 0.20f, 1.0f); + ::XCEngine::UI::UIColor(0.19f, 0.19f, 0.19f, 1.0f); ::XCEngine::UI::UIColor buttonBorderColor = - ::XCEngine::UI::UIColor(0.36f, 0.36f, 0.36f, 1.0f); + ::XCEngine::UI::UIColor(0.29f, 0.29f, 0.29f, 1.0f); ::XCEngine::UI::UIColor iconColor = - ::XCEngine::UI::UIColor(0.84f, 0.84f, 0.84f, 1.0f); + ::XCEngine::UI::UIColor(0.82f, 0.82f, 0.82f, 1.0f); }; struct UIEditorShellComposeModel { @@ -66,9 +66,9 @@ struct UIEditorShellComposeState { }; struct UIEditorShellComposeMetrics { - float outerPadding = 12.0f; - float sectionGap = 8.0f; - float surfaceCornerRounding = 10.0f; + float outerPadding = 0.0f; + float sectionGap = 0.0f; + float surfaceCornerRounding = 0.0f; Widgets::UIEditorMenuBarMetrics menuBarMetrics = {}; UIEditorShellToolbarMetrics toolbarMetrics = {}; Widgets::UIEditorDockHostMetrics dockHostMetrics = {}; diff --git a/new_editor/include/XCEditor/Shell/UIEditorStatusBar.h b/new_editor/include/XCEditor/Shell/UIEditorStatusBar.h index 09158fe7..acced79c 100644 --- a/new_editor/include/XCEditor/Shell/UIEditorStatusBar.h +++ b/new_editor/include/XCEditor/Shell/UIEditorStatusBar.h @@ -48,43 +48,43 @@ struct UIEditorStatusBarState { }; struct UIEditorStatusBarMetrics { - float barHeight = 28.0f; - float outerPaddingX = 10.0f; - float segmentPaddingX = 10.0f; - float segmentPaddingY = 6.0f; - float segmentGap = 4.0f; + float barHeight = 22.0f; + float outerPaddingX = 8.0f; + float segmentPaddingX = 8.0f; + float segmentPaddingY = 4.0f; + float segmentGap = 2.0f; float separatorWidth = 1.0f; - float separatorInsetY = 6.0f; + float separatorInsetY = 5.0f; float slotGapMin = 18.0f; - float cornerRounding = 8.0f; - float estimatedGlyphWidth = 7.0f; + float cornerRounding = 0.0f; + float estimatedGlyphWidth = 6.5f; float borderThickness = 1.0f; - float focusedBorderThickness = 2.0f; + float focusedBorderThickness = 1.0f; }; struct UIEditorStatusBarPalette { ::XCEngine::UI::UIColor surfaceColor = - ::XCEngine::UI::UIColor(0.15f, 0.15f, 0.16f, 1.0f); + ::XCEngine::UI::UIColor(0.16f, 0.16f, 0.16f, 1.0f); ::XCEngine::UI::UIColor borderColor = - ::XCEngine::UI::UIColor(0.30f, 0.32f, 0.34f, 1.0f); + ::XCEngine::UI::UIColor(0.23f, 0.23f, 0.23f, 1.0f); ::XCEngine::UI::UIColor focusedBorderColor = - ::XCEngine::UI::UIColor(0.78f, 0.80f, 0.84f, 1.0f); + ::XCEngine::UI::UIColor(0.35f, 0.35f, 0.35f, 1.0f); ::XCEngine::UI::UIColor segmentColor = - ::XCEngine::UI::UIColor(0.19f, 0.19f, 0.21f, 1.0f); + ::XCEngine::UI::UIColor(0.18f, 0.18f, 0.18f, 1.0f); ::XCEngine::UI::UIColor segmentHoveredColor = - ::XCEngine::UI::UIColor(0.24f, 0.26f, 0.28f, 1.0f); + ::XCEngine::UI::UIColor(0.22f, 0.22f, 0.22f, 1.0f); ::XCEngine::UI::UIColor segmentActiveColor = - ::XCEngine::UI::UIColor(0.30f, 0.32f, 0.35f, 1.0f); + ::XCEngine::UI::UIColor(0.25f, 0.25f, 0.25f, 1.0f); ::XCEngine::UI::UIColor segmentBorderColor = - ::XCEngine::UI::UIColor(0.42f, 0.44f, 0.47f, 1.0f); + ::XCEngine::UI::UIColor(0.29f, 0.29f, 0.29f, 1.0f); ::XCEngine::UI::UIColor separatorColor = - ::XCEngine::UI::UIColor(0.32f, 0.34f, 0.36f, 1.0f); + ::XCEngine::UI::UIColor(0.27f, 0.27f, 0.27f, 1.0f); ::XCEngine::UI::UIColor textPrimary = - ::XCEngine::UI::UIColor(0.93f, 0.94f, 0.96f, 1.0f); + ::XCEngine::UI::UIColor(0.84f, 0.84f, 0.84f, 1.0f); ::XCEngine::UI::UIColor textMuted = - ::XCEngine::UI::UIColor(0.58f, 0.59f, 0.62f, 1.0f); + ::XCEngine::UI::UIColor(0.62f, 0.62f, 0.62f, 1.0f); ::XCEngine::UI::UIColor textAccent = - ::XCEngine::UI::UIColor(0.82f, 0.86f, 0.93f, 1.0f); + ::XCEngine::UI::UIColor(0.84f, 0.84f, 0.84f, 1.0f); }; struct UIEditorStatusBarLayout { diff --git a/new_editor/include/XCEditor/Shell/UIEditorViewportSlot.h b/new_editor/include/XCEditor/Shell/UIEditorViewportSlot.h index d6137329..68d8e4ff 100644 --- a/new_editor/include/XCEditor/Shell/UIEditorViewportSlot.h +++ b/new_editor/include/XCEditor/Shell/UIEditorViewportSlot.h @@ -43,8 +43,8 @@ struct UIEditorViewportSlotChrome { std::string_view subtitle = {}; bool showTopBar = true; bool showBottomBar = true; - float topBarHeight = 40.0f; - float bottomBarHeight = 28.0f; + float topBarHeight = 24.0f; + float bottomBarHeight = 22.0f; }; struct UIEditorViewportSlotToolItem { @@ -67,30 +67,30 @@ struct UIEditorViewportSlotState { }; struct UIEditorViewportSlotMetrics { - float cornerRounding = 10.0f; + float cornerRounding = 0.0f; float outerBorderThickness = 1.0f; - float focusedBorderThickness = 1.5f; - float topBarPaddingX = 12.0f; - float topBarPaddingY = 7.0f; - float toolPaddingX = 10.0f; - float toolGap = 6.0f; - float toolCornerRounding = 6.0f; - float titleGap = 10.0f; - float titleInsetY = 10.0f; - float subtitleInsetY = 25.0f; - float estimatedGlyphWidth = 7.0f; + float focusedBorderThickness = 1.0f; + float topBarPaddingX = 8.0f; + float topBarPaddingY = 4.0f; + float toolPaddingX = 8.0f; + float toolGap = 4.0f; + float toolCornerRounding = 2.0f; + float titleGap = 6.0f; + float titleInsetY = 5.0f; + float subtitleInsetY = 14.0f; + float estimatedGlyphWidth = 6.5f; float surfaceInset = 0.0f; float surfaceBorderThickness = 1.0f; - float focusedSurfaceBorderThickness = 1.5f; + float focusedSurfaceBorderThickness = 1.0f; }; struct UIEditorViewportSlotPalette { ::XCEngine::UI::UIColor frameColor = - ::XCEngine::UI::UIColor(0.14f, 0.14f, 0.14f, 1.0f); + ::XCEngine::UI::UIColor(0.17f, 0.17f, 0.17f, 1.0f); ::XCEngine::UI::UIColor topBarColor = - ::XCEngine::UI::UIColor(0.18f, 0.18f, 0.18f, 1.0f); + ::XCEngine::UI::UIColor(0.20f, 0.20f, 0.20f, 1.0f); ::XCEngine::UI::UIColor surfaceColor = - ::XCEngine::UI::UIColor(0.10f, 0.10f, 0.10f, 1.0f); + ::XCEngine::UI::UIColor(0.14f, 0.14f, 0.14f, 1.0f); ::XCEngine::UI::UIColor surfaceHoverOverlayColor = ::XCEngine::UI::UIColor(0.22f, 0.22f, 0.22f, 0.24f); ::XCEngine::UI::UIColor surfaceActiveOverlayColor = @@ -98,33 +98,33 @@ struct UIEditorViewportSlotPalette { ::XCEngine::UI::UIColor captureOverlayColor = ::XCEngine::UI::UIColor(0.70f, 0.70f, 0.70f, 0.10f); ::XCEngine::UI::UIColor borderColor = - ::XCEngine::UI::UIColor(0.28f, 0.28f, 0.28f, 1.0f); + ::XCEngine::UI::UIColor(0.23f, 0.23f, 0.23f, 1.0f); ::XCEngine::UI::UIColor focusedBorderColor = - ::XCEngine::UI::UIColor(0.84f, 0.84f, 0.84f, 1.0f); + ::XCEngine::UI::UIColor(0.36f, 0.36f, 0.36f, 1.0f); ::XCEngine::UI::UIColor surfaceBorderColor = ::XCEngine::UI::UIColor(0.22f, 0.22f, 0.22f, 1.0f); ::XCEngine::UI::UIColor surfaceHoveredBorderColor = - ::XCEngine::UI::UIColor(0.44f, 0.44f, 0.44f, 1.0f); + ::XCEngine::UI::UIColor(0.28f, 0.28f, 0.28f, 1.0f); ::XCEngine::UI::UIColor surfaceActiveBorderColor = - ::XCEngine::UI::UIColor(0.64f, 0.64f, 0.64f, 1.0f); + ::XCEngine::UI::UIColor(0.33f, 0.33f, 0.33f, 1.0f); ::XCEngine::UI::UIColor surfaceCapturedBorderColor = - ::XCEngine::UI::UIColor(0.86f, 0.86f, 0.86f, 1.0f); + ::XCEngine::UI::UIColor(0.38f, 0.38f, 0.38f, 1.0f); ::XCEngine::UI::UIColor toolColor = - ::XCEngine::UI::UIColor(0.24f, 0.24f, 0.24f, 1.0f); + ::XCEngine::UI::UIColor(0.21f, 0.21f, 0.21f, 1.0f); ::XCEngine::UI::UIColor toolHoveredColor = - ::XCEngine::UI::UIColor(0.31f, 0.31f, 0.31f, 1.0f); + ::XCEngine::UI::UIColor(0.24f, 0.24f, 0.24f, 1.0f); ::XCEngine::UI::UIColor toolSelectedColor = - ::XCEngine::UI::UIColor(0.39f, 0.39f, 0.39f, 1.0f); + ::XCEngine::UI::UIColor(0.27f, 0.27f, 0.27f, 1.0f); ::XCEngine::UI::UIColor toolDisabledColor = - ::XCEngine::UI::UIColor(0.19f, 0.19f, 0.19f, 1.0f); + ::XCEngine::UI::UIColor(0.18f, 0.18f, 0.18f, 1.0f); ::XCEngine::UI::UIColor toolBorderColor = - ::XCEngine::UI::UIColor(0.40f, 0.40f, 0.40f, 1.0f); + ::XCEngine::UI::UIColor(0.28f, 0.28f, 0.28f, 1.0f); ::XCEngine::UI::UIColor textPrimary = - ::XCEngine::UI::UIColor(0.94f, 0.94f, 0.94f, 1.0f); + ::XCEngine::UI::UIColor(0.86f, 0.86f, 0.86f, 1.0f); ::XCEngine::UI::UIColor textSecondary = - ::XCEngine::UI::UIColor(0.76f, 0.76f, 0.76f, 1.0f); + ::XCEngine::UI::UIColor(0.68f, 0.68f, 0.68f, 1.0f); ::XCEngine::UI::UIColor textMuted = - ::XCEngine::UI::UIColor(0.62f, 0.62f, 0.62f, 1.0f); + ::XCEngine::UI::UIColor(0.58f, 0.58f, 0.58f, 1.0f); ::XCEngine::UI::UIColor imageTint = ::XCEngine::UI::UIColor(1.0f, 1.0f, 1.0f, 1.0f); UIEditorStatusBarPalette statusBarPalette = {}; diff --git a/new_editor/src/Collections/UIEditorTabStrip.cpp b/new_editor/src/Collections/UIEditorTabStrip.cpp index 0d592b2a..d2004f50 100644 --- a/new_editor/src/Collections/UIEditorTabStrip.cpp +++ b/new_editor/src/Collections/UIEditorTabStrip.cpp @@ -16,10 +16,10 @@ using ::XCEngine::UI::UIRect; using ::XCEngine::UI::Layout::ArrangeUITabStrip; using ::XCEngine::UI::Layout::MeasureUITabStripHeaderWidth; -constexpr float kTabRounding = 7.0f; -constexpr float kStripRounding = 8.0f; -constexpr float kHeaderFontSize = 13.0f; -constexpr float kCloseFontSize = 11.0f; +constexpr float kTabRounding = 0.0f; +constexpr float kStripRounding = 0.0f; +constexpr float kHeaderFontSize = 11.0f; +constexpr float kCloseFontSize = 10.0f; float ClampNonNegative(float value) { return (std::max)(value, 0.0f); @@ -35,17 +35,17 @@ bool IsPointInsideRect( } float ResolveStripRounding(const UIEditorTabStripMetrics& metrics) { - return (std::max)( - (std::min)(ClampNonNegative(metrics.layoutMetrics.headerHeight) * 0.25f, kStripRounding), - 0.0f); + (void)metrics; + return kStripRounding; } float ResolveTabRounding(const UIEditorTabStripMetrics& metrics) { - return (std::max)(ResolveStripRounding(metrics) - 1.0f, 0.0f); + (void)metrics; + return kTabRounding; } float ResolveCloseButtonRounding(const UIEditorTabStripMetrics& metrics) { - return (std::min)(ClampNonNegative(metrics.closeButtonExtent) * 0.35f, 5.0f); + return (std::min)(ClampNonNegative(metrics.closeButtonExtent) * 0.2f, 2.0f); } std::size_t ResolveSelectedIndex( diff --git a/new_editor/src/Shell/UIEditorDockHost.cpp b/new_editor/src/Shell/UIEditorDockHost.cpp index d50c00d9..46074f02 100644 --- a/new_editor/src/Shell/UIEditorDockHost.cpp +++ b/new_editor/src/Shell/UIEditorDockHost.cpp @@ -23,8 +23,8 @@ using ::XCEngine::UI::Layout::UITabStripMeasureItem; using ::XCEngine::UI::Layout::UILayoutAxis; using ::XCEngine::UI::Widgets::ExpandUISplitterHandleHitRect; -constexpr std::string_view kStandalonePanelActiveFooter = "Active panel"; -constexpr std::string_view kStandalonePanelInactiveFooter = "Panel placeholder"; +constexpr std::string_view kStandalonePanelActiveFooter = ""; +constexpr std::string_view kStandalonePanelInactiveFooter = ""; struct DockMeasureResult { bool visible = false; @@ -97,7 +97,8 @@ UIEditorPanelFrameMetrics BuildTabContentFrameMetrics( frameMetrics.actionButtonExtent = 0.0f; frameMetrics.actionInsetX = 0.0f; frameMetrics.actionGap = 0.0f; - frameMetrics.cornerRounding = (std::max)(frameMetrics.cornerRounding - 1.0f, 0.0f); + frameMetrics.contentPadding = 0.0f; + frameMetrics.cornerRounding = 0.0f; return frameMetrics; } @@ -750,7 +751,7 @@ void AppendUIEditorDockHostForeground( panel.frameState, UIEditorPanelFrameText{ panel.title, - panel.panelId, + {}, panel.active ? kStandalonePanelActiveFooter : kStandalonePanelInactiveFooter }, palette.panelFramePalette, diff --git a/new_editor/src/Shell/UIEditorPanelFrame.cpp b/new_editor/src/Shell/UIEditorPanelFrame.cpp index 735062e1..0676d2fa 100644 --- a/new_editor/src/Shell/UIEditorPanelFrame.cpp +++ b/new_editor/src/Shell/UIEditorPanelFrame.cpp @@ -26,15 +26,15 @@ float ResolveActionButtonExtent( } float ResolveActionCornerRounding(const UIRect& rect) { - return (std::min)((std::max)((std::min)(rect.width, rect.height) * 0.35f, 0.0f), 6.0f); + return (std::min)((std::max)((std::min)(rect.width, rect.height) * 0.15f, 0.0f), 2.0f); } float ResolveActionGlyphLeft(const UIRect& rect) { - return rect.x + (std::max)(0.0f, (rect.width - 7.0f) * 0.5f); + return rect.x + (std::max)(0.0f, (rect.width - 6.0f) * 0.5f); } float ResolveActionGlyphTop(const UIRect& rect) { - return rect.y + (std::max)(0.0f, (rect.height - 12.0f) * 0.5f) - 0.5f; + return rect.y + (std::max)(0.0f, (rect.height - 10.0f) * 0.5f) - 0.5f; } UIColor ResolveActionFillColor( @@ -77,7 +77,7 @@ void AppendActionButton( UIPoint(ResolveActionGlyphLeft(rect), ResolveActionGlyphTop(rect)), std::string(glyph), palette.actionGlyphColor, - 12.0f); + 10.0f); } } // namespace @@ -282,9 +282,19 @@ void AppendUIEditorPanelFrameBackground( metrics.cornerRounding); if (layout.headerRect.height > 0.0f) { drawList.AddFilledRect(layout.headerRect, palette.headerColor, metrics.cornerRounding); + drawList.AddLine( + UIPoint(layout.headerRect.x, layout.headerRect.y + layout.headerRect.height - 1.0f), + UIPoint(layout.headerRect.x + layout.headerRect.width, layout.headerRect.y + layout.headerRect.height - 1.0f), + palette.borderColor, + 1.0f); } if (layout.hasFooter && layout.footerRect.height > 0.0f) { drawList.AddFilledRect(layout.footerRect, palette.footerColor, metrics.cornerRounding); + drawList.AddLine( + UIPoint(layout.footerRect.x, layout.footerRect.y), + UIPoint(layout.footerRect.x + layout.footerRect.width, layout.footerRect.y), + palette.borderColor, + 1.0f); } } @@ -300,7 +310,7 @@ void AppendUIEditorPanelFrameForeground( UIPoint(layout.frameRect.x + metrics.titleInsetX, layout.headerRect.y + metrics.titleInsetY), std::string(text.title), palette.textPrimary, - 16.0f); + 13.0f); } if (!text.subtitle.empty()) { @@ -308,7 +318,7 @@ void AppendUIEditorPanelFrameForeground( UIPoint(layout.frameRect.x + metrics.titleInsetX, layout.headerRect.y + metrics.subtitleInsetY), std::string(text.subtitle), palette.textSecondary, - 12.0f); + 10.0f); } if (layout.hasFooter && !text.footer.empty()) { @@ -316,7 +326,7 @@ void AppendUIEditorPanelFrameForeground( UIPoint(layout.footerRect.x + metrics.footerInsetX, layout.footerRect.y + metrics.footerInsetY), std::string(text.footer), palette.textMuted, - 11.0f); + 10.0f); } if (layout.showPinButton) { diff --git a/new_editor/src/Shell/UIEditorViewportSlot.cpp b/new_editor/src/Shell/UIEditorViewportSlot.cpp index 9eb84242..5bca6145 100644 --- a/new_editor/src/Shell/UIEditorViewportSlot.cpp +++ b/new_editor/src/Shell/UIEditorViewportSlot.cpp @@ -425,7 +425,7 @@ void AppendUIEditorViewportSlotForeground( UIPoint(layout.titleRect.x, layout.topBarRect.y + metrics.titleInsetY), std::string(chrome.title), palette.textPrimary, - 15.0f); + 13.0f); } if (!chrome.subtitle.empty()) { @@ -433,7 +433,7 @@ void AppendUIEditorViewportSlotForeground( UIPoint(layout.subtitleRect.x, layout.topBarRect.y + metrics.subtitleInsetY), std::string(chrome.subtitle), palette.textSecondary, - 11.0f); + 10.0f); } for (std::size_t index = 0u; index < toolItems.size(); ++index) { @@ -444,10 +444,10 @@ void AppendUIEditorViewportSlotForeground( drawList.AddText( UIPoint( layout.toolItemRects[index].x + metrics.toolPaddingX, - layout.toolItemRects[index].y + 5.0f), + layout.toolItemRects[index].y + 3.0f), toolItems[index].label, toolItems[index].enabled ? palette.textPrimary : palette.textMuted, - 12.0f); + 11.0f); } }