refactor(new_editor): split utility window semantics from workspace
This commit is contained in:
@@ -51,17 +51,6 @@ bool HasUIEditorSingleVisibleRootTab(
|
||||
return ResolveUIEditorSingleVisibleRootPanelDescriptor(controller) != nullptr;
|
||||
}
|
||||
|
||||
bool IsUIEditorDetachedWorkspaceToolWindow(
|
||||
const UIEditorWorkspaceController& controller) {
|
||||
if (const UIEditorPanelDescriptor* descriptor =
|
||||
ResolveUIEditorSingleVisibleRootPanelDescriptor(controller);
|
||||
descriptor != nullptr) {
|
||||
return descriptor->toolWindow;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string ResolveUIEditorDetachedWorkspaceTitle(
|
||||
const UIEditorWorkspaceController& controller,
|
||||
std::string_view fallbackTitle) {
|
||||
@@ -90,40 +79,4 @@ std::string ResolveUIEditorDetachedWorkspaceTitle(
|
||||
return fallbackSize;
|
||||
}
|
||||
|
||||
::XCEngine::UI::UISize ResolveUIEditorDetachedToolWindowMinimumContentSize(
|
||||
const UIEditorWorkspaceController& controller,
|
||||
const ::XCEngine::UI::UISize& fallbackContentSize,
|
||||
float detachedWindowChromeHeight) {
|
||||
if (const UIEditorPanelDescriptor* descriptor =
|
||||
ResolveUIEditorSingleVisibleRootPanelDescriptor(controller);
|
||||
descriptor != nullptr && descriptor->toolWindow) {
|
||||
const float minimumContentWidth =
|
||||
descriptor->minimumDetachedWindowSize.width > 0.0f
|
||||
? descriptor->minimumDetachedWindowSize.width
|
||||
: fallbackContentSize.width;
|
||||
const float minimumContentHeight =
|
||||
descriptor->minimumDetachedWindowSize.height > detachedWindowChromeHeight
|
||||
? descriptor->minimumDetachedWindowSize.height - detachedWindowChromeHeight
|
||||
: fallbackContentSize.height;
|
||||
return ::XCEngine::UI::UISize(minimumContentWidth, minimumContentHeight);
|
||||
}
|
||||
|
||||
return fallbackContentSize;
|
||||
}
|
||||
|
||||
::XCEngine::UI::UISize ResolveUIEditorDetachedPanelPreferredWindowSize(
|
||||
const UIEditorPanelRegistry& panelRegistry,
|
||||
std::string_view panelId,
|
||||
const ::XCEngine::UI::UISize& fallbackSize) {
|
||||
const UIEditorPanelDescriptor* descriptor =
|
||||
FindUIEditorPanelDescriptor(panelRegistry, panelId);
|
||||
if (descriptor == nullptr ||
|
||||
descriptor->preferredDetachedWindowSize.width <= 0.0f ||
|
||||
descriptor->preferredDetachedWindowSize.height <= 0.0f) {
|
||||
return fallbackSize;
|
||||
}
|
||||
|
||||
return descriptor->preferredDetachedWindowSize;
|
||||
}
|
||||
|
||||
} // namespace XCEngine::UI::Editor
|
||||
|
||||
Reference in New Issue
Block a user