refactor(new_editor/app): reorganize host structure and add smoke test

This commit is contained in:
2026-04-15 08:24:06 +08:00
parent 3617b4840b
commit 9e5954cf0a
235 changed files with 11157 additions and 10028 deletions

View File

@@ -1,4 +1,4 @@
#include "ProductConsolePanel.h"
#include "ConsolePanel.h"
#include <XCEditor/Foundation/UIEditorTheme.h>
@@ -20,9 +20,9 @@ constexpr float kLineHeight = 18.0f;
constexpr float kFontSize = 11.0f;
constexpr UIColor kSurfaceColor(0.10f, 0.10f, 0.10f, 1.0f);
constexpr UIColor kTextColor(0.860f, 0.860f, 0.860f, 1.0f);
constexpr UIColor kChannelColor(0.660f, 0.660f, 0.660f, 1.0f);
constexpr UIColor kEmptyColor(0.580f, 0.580f, 0.580f, 1.0f);
constexpr UIColor kTextColor(0.890f, 0.890f, 0.890f, 1.0f);
constexpr UIColor kChannelColor(0.680f, 0.680f, 0.680f, 1.0f);
constexpr UIColor kEmptyColor(0.620f, 0.620f, 0.620f, 1.0f);
float ResolveTextTop(float rectY, float rectHeight, float fontSize) {
const float lineHeight = fontSize * 1.6f;
@@ -31,7 +31,7 @@ float ResolveTextTop(float rectY, float rectHeight, float fontSize) {
} // namespace
const UIEditorPanelContentHostPanelState* ProductConsolePanel::FindMountedConsolePanel(
const UIEditorPanelContentHostPanelState* ConsolePanel::FindMountedConsolePanel(
const UIEditorPanelContentHostFrame& contentHostFrame) const {
for (const UIEditorPanelContentHostPanelState& panelState : contentHostFrame.panelStates) {
if (panelState.panelId == kConsolePanelId && panelState.mounted) {
@@ -42,8 +42,8 @@ const UIEditorPanelContentHostPanelState* ProductConsolePanel::FindMountedConsol
return nullptr;
}
void ProductConsolePanel::Update(
const ProductEditorSession& session,
void ConsolePanel::Update(
const EditorSession& session,
const UIEditorPanelContentHostFrame& contentHostFrame) {
const UIEditorPanelContentHostPanelState* panelState =
FindMountedConsolePanel(contentHostFrame);
@@ -59,7 +59,7 @@ void ProductConsolePanel::Update(
m_entries = &session.consoleEntries;
}
void ProductConsolePanel::Append(UIDrawList& drawList) const {
void ConsolePanel::Append(UIDrawList& drawList) const {
if (!m_visible || m_bounds.width <= 0.0f || m_bounds.height <= 0.0f) {
return;
}
@@ -91,7 +91,7 @@ void ProductConsolePanel::Append(UIDrawList& drawList) const {
drawList.PushClipRect(contentRect);
float nextY = contentRect.y;
for (std::size_t index = firstVisible; index < entryCount; ++index) {
const ProductEditorConsoleEntry& entry = (*m_entries)[index];
const EditorConsoleEntry& entry = (*m_entries)[index];
const std::string line = entry.channel.empty()
? entry.message
: "[" + entry.channel + "] " + entry.message;
@@ -107,3 +107,4 @@ void ProductConsolePanel::Append(UIDrawList& drawList) const {
}
} // namespace XCEngine::UI::Editor::App