Refactor XCUI editor module layout
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
#define NOMINMAX
|
||||
#endif
|
||||
|
||||
#include <XCEditor/Core/UIEditorScrollViewInteraction.h>
|
||||
#include <XCEditor/Widgets/UIEditorScrollView.h>
|
||||
#include <XCEditor/Collections/UIEditorScrollViewInteraction.h>
|
||||
#include <XCEditor/Collections/UIEditorScrollView.h>
|
||||
#include "Host/AutoScreenshot.h"
|
||||
#include "Host/NativeRenderer.h"
|
||||
|
||||
@@ -194,7 +194,7 @@ std::string DescribeHitTarget(const UIEditorScrollViewHitTarget& hitTarget) {
|
||||
return "scrollbar-thumb";
|
||||
case UIEditorScrollViewHitTargetKind::None:
|
||||
default:
|
||||
return "无";
|
||||
return "none";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -423,7 +423,7 @@ private:
|
||||
m_mousePosition = UIPoint(-1000.0f, -1000.0f);
|
||||
m_hoveredAction = ActionId::Reset;
|
||||
m_hasHoveredAction = false;
|
||||
m_lastResult = "已重置到 " + std::to_string(m_logLines.size()) + " 行默认滚动位置";
|
||||
m_lastResult = "已重置到 " + std::to_string(m_logLines.size()) + " 行默认滚动内容";
|
||||
RefreshScrollFrame();
|
||||
}
|
||||
|
||||
@@ -478,7 +478,7 @@ private:
|
||||
const UIEditorScrollViewInteractionResult result =
|
||||
PumpScrollEvents({ MakeWheelEvent(m_mousePosition, wheelDelta) });
|
||||
if (result.offsetChanged) {
|
||||
m_lastResult = "滚轮滚动: offset 已更新";
|
||||
m_lastResult = "滚轮滚动:offset 已更新";
|
||||
}
|
||||
InvalidateRect(m_hwnd, nullptr, FALSE);
|
||||
}
|
||||
@@ -568,23 +568,23 @@ private:
|
||||
}
|
||||
|
||||
if (result.offsetChanged) {
|
||||
m_lastResult = "滚动位置变化";
|
||||
m_lastResult = "滚动位置已变化";
|
||||
return;
|
||||
}
|
||||
|
||||
if (result.focusChanged) {
|
||||
m_lastResult = m_interactionState.scrollViewState.focused
|
||||
? "ScrollView 获得 focus"
|
||||
? "ScrollView 已获得 focus"
|
||||
: "ScrollView focus 已清除";
|
||||
return;
|
||||
}
|
||||
|
||||
if (insideScrollView) {
|
||||
m_lastResult = "点击内容区域: 只验证 focus / hover / scrollbar";
|
||||
m_lastResult = "点击内容区:只验证 focus / hover / scrollbar";
|
||||
return;
|
||||
}
|
||||
|
||||
m_lastResult = "等待交互";
|
||||
m_lastResult = "无变化";
|
||||
}
|
||||
|
||||
void ExecuteAction(ActionId action) {
|
||||
@@ -622,31 +622,31 @@ private:
|
||||
DrawCard(
|
||||
drawList,
|
||||
layout.introRect,
|
||||
"这个测试在验证什么功能",
|
||||
"只验证 Editor ScrollView 基础控件,不涉及任何业务面板。");
|
||||
"这个测试验证什么功能?",
|
||||
"验证滚动视图的滚轮滚动、thumb 拖拽、focus 切换和 offset clamp。");
|
||||
drawList.AddText(
|
||||
UIPoint(layout.introRect.x + 16.0f, layout.introRect.y + 72.0f),
|
||||
"1. 把鼠标放到右侧日志区内滚动滚轮:内容应上下移动,offset 应变化。",
|
||||
"1. 在内容区滚轮滚动,检查 offset 是否连续更新。",
|
||||
kTextPrimary,
|
||||
12.0f);
|
||||
drawList.AddText(
|
||||
UIPoint(layout.introRect.x + 16.0f, layout.introRect.y + 94.0f),
|
||||
"2. 继续滚到边界后 offset 要被 clamp,不能越界。",
|
||||
"2. 滚到底部后继续滚动,offset 必须被 clamp。",
|
||||
kTextPrimary,
|
||||
12.0f);
|
||||
drawList.AddText(
|
||||
UIPoint(layout.introRect.x + 16.0f, layout.introRect.y + 116.0f),
|
||||
"3. 拖拽 scrollbar thumb,内容位置应同步变化。",
|
||||
"3. 拖拽 scrollbar thumb,检查 offset 与 thumb 位置是否同步。",
|
||||
kTextPrimary,
|
||||
12.0f);
|
||||
drawList.AddText(
|
||||
UIPoint(layout.introRect.x + 16.0f, layout.introRect.y + 138.0f),
|
||||
"4. 点击内容区只改变 focus;点击外部空白后 focus 应清除。",
|
||||
"4. 点击内容区只更新 focus / hover;点击外部应能清掉 focus。",
|
||||
kTextPrimary,
|
||||
12.0f);
|
||||
drawList.AddText(
|
||||
UIPoint(layout.introRect.x + 16.0f, layout.introRect.y + 160.0f),
|
||||
"5. 按 F12 手动截图;设置 XCUI_AUTO_CAPTURE_ON_STARTUP=1 可自动截图。",
|
||||
"5. 按 F12 或设置 XCUI_AUTO_CAPTURE_ON_STARTUP=1 触发截图。",
|
||||
kTextPrimary,
|
||||
12.0f);
|
||||
|
||||
@@ -666,7 +666,7 @@ private:
|
||||
12.0f);
|
||||
drawList.AddText(
|
||||
UIPoint(layout.stateRect.x + 16.0f, layout.stateRect.y + 94.0f),
|
||||
std::string("Focused: ") + (m_interactionState.scrollViewState.focused ? "开" : "关"),
|
||||
std::string("Focused: ") + (m_interactionState.scrollViewState.focused ? "是" : "否"),
|
||||
kTextPrimary,
|
||||
12.0f);
|
||||
drawList.AddText(
|
||||
|
||||
Reference in New Issue
Block a user