Refine editor window host structure and utility chrome

This commit is contained in:
2026-04-25 18:20:17 +08:00
parent 41b912933d
commit 7335def3fd
31 changed files with 241 additions and 61 deletions

View File

@@ -0,0 +1,64 @@
#pragma once
#ifndef NOMINMAX
#define NOMINMAX
#endif
#include "UtilityWindows/EditorUtilityWindowKind.h"
#include <windows.h>
#include <optional>
#include <string>
namespace XCEngine::UI::Editor::App {
struct EditorWindowPanelTransferRequest {
std::string nodeId = {};
std::string panelId = {};
POINT screenPoint = {};
bool IsValid() const {
return !nodeId.empty() && !panelId.empty();
}
};
struct EditorWindowOpenUtilityWindowRequest {
EditorUtilityWindowKind kind = EditorUtilityWindowKind::None;
POINT screenPoint = {};
bool useCursorPlacement = false;
bool IsValid() const {
return kind != EditorUtilityWindowKind::None;
}
};
struct EditorWorkspaceWindowFrameTransferRequests {
std::optional<EditorWindowPanelTransferRequest> beginGlobalTabDrag = {};
std::optional<EditorWindowPanelTransferRequest> detachPanel = {};
bool HasPendingRequests() const {
return beginGlobalTabDrag.has_value() ||
detachPanel.has_value();
}
};
struct EditorUtilityWindowFrameTransferRequests {
std::optional<EditorWindowOpenUtilityWindowRequest> openUtilityWindow = {};
bool HasPendingRequests() const {
return openUtilityWindow.has_value();
}
};
struct EditorWindowFrameTransferRequests {
EditorWorkspaceWindowFrameTransferRequests workspace = {};
EditorUtilityWindowFrameTransferRequests utility = {};
bool HasPendingRequests() const {
return workspace.HasPendingRequests() ||
utility.HasPendingRequests();
}
};
} // namespace XCEngine::UI::Editor::App