Tighten new editor shell chrome and add dock convergence plan

This commit is contained in:
2026-04-10 21:05:07 +08:00
parent 503e6408ed
commit 87ad489bfd
13 changed files with 549 additions and 179 deletions

View File

@@ -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,

View File

@@ -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) {

View File

@@ -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);
}
}