Refine XCEditor docking and DPI rendering

This commit is contained in:
2026-04-11 17:07:37 +08:00
parent 35d3d6328b
commit 2958dcc491
46 changed files with 4839 additions and 471 deletions

View File

@@ -196,11 +196,6 @@ std::string DescribeHitTarget(
return "Tab: " + items[target.index].title;
}
return "Tab";
case UIEditorTabStripHitTargetKind::CloseButton:
if (target.index < items.size()) {
return "CloseButton: " + items[target.index].title;
}
return "CloseButton";
case UIEditorTabStripHitTargetKind::None:
default:
return "None";
@@ -218,9 +213,6 @@ std::string JoinTabTitles(const std::vector<UIEditorTabStripItem>& items) {
stream << " | ";
}
stream << items[index].title;
if (!items[index].closable) {
stream << " (locked)";
}
}
return stream.str();
}
@@ -502,15 +494,6 @@ private:
void ApplyInteractionResult(
const UIEditorTabStripInteractionResult& result,
std::string_view source) {
if (result.closeRequested && !result.closedTabId.empty()) {
DispatchCommand(
UIEditorWorkspaceCommandKind::ClosePanel,
result.closedTabId,
std::string(source) + " Close -> " + result.closedTabId);
PumpTabStripEvents({});
return;
}
if ((result.selectionChanged || result.keyboardNavigated) &&
!result.selectedTabId.empty()) {
DispatchCommand(
@@ -609,7 +592,7 @@ private:
drawList,
introRect,
"这个测试验证什么功能?",
"验证 TabStrip 的 header 命中、选中切换、关闭请求和键盘导航,不接业务面板。");
"验证 TabStrip 的 header 命中、选中切换和键盘导航,不接业务面板。");
drawList.AddText(
UIPoint(introRect.x + 16.0f, introRect.y + 68.0f),
"1. 点击 tab检查 selected / active panel 是否同步。",
@@ -617,7 +600,7 @@ private:
12.0f);
drawList.AddText(
UIPoint(introRect.x + 16.0f, introRect.y + 92.0f),
"2. 点击 X只验证关闭请求Document C 没有关闭按钮",
"2. 所有 tab 都没有关闭按钮这里只验证命中、focus 和选中同步",
kTextMuted,
12.0f);
drawList.AddText(
@@ -719,7 +702,7 @@ private:
12.0f);
drawList.AddText(
UIPoint(m_layout.contentRect.x + 20.0f, m_layout.contentRect.y + 100.0f),
"可点击 Document B 切换,或点击 Document C 验证不可关闭 tab",
"可点击 Document B 切换,再用 Left / Right / Home / End 验证键盘导航",
kTextWeak,
12.0f);