refactor(new_editor): split utility window semantics from workspace
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
#include "Platform/Win32/EditorUtilityWindowRegistry.h"
|
||||
|
||||
#include "Platform/Win32/EditorColorPickerUtilityWindowContentController.h"
|
||||
|
||||
namespace XCEngine::UI::Editor::App {
|
||||
|
||||
namespace {
|
||||
|
||||
using ::XCEngine::UI::UISize;
|
||||
|
||||
constexpr EditorUtilityWindowDescriptor kColorPickerUtilityWindowDescriptor = {
|
||||
.kind = EditorUtilityWindowKind::ColorPicker,
|
||||
.windowId = "utility.color-picker",
|
||||
.title = L"Color Picker",
|
||||
.preferredOuterSize = UISize(352.0f, 500.0f),
|
||||
.minimumOuterSize = UISize(320.0f, 460.0f),
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
const EditorUtilityWindowDescriptor* ResolveEditorUtilityWindowDescriptor(
|
||||
EditorUtilityWindowKind kind) {
|
||||
switch (kind) {
|
||||
case EditorUtilityWindowKind::ColorPicker:
|
||||
return &kColorPickerUtilityWindowDescriptor;
|
||||
case EditorUtilityWindowKind::None:
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
std::unique_ptr<EditorWindowContentController> CreateEditorUtilityWindowContentController(
|
||||
EditorUtilityWindowKind kind) {
|
||||
const EditorUtilityWindowDescriptor* descriptor =
|
||||
ResolveEditorUtilityWindowDescriptor(kind);
|
||||
if (descriptor == nullptr) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
switch (kind) {
|
||||
case EditorUtilityWindowKind::ColorPicker:
|
||||
return CreateEditorColorPickerUtilityWindowContentController(
|
||||
descriptor->minimumOuterSize);
|
||||
case EditorUtilityWindowKind::None:
|
||||
default:
|
||||
return nullptr;
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace XCEngine::UI::Editor::App
|
||||
Reference in New Issue
Block a user