Add workspace panel overlay routing
This commit is contained in:
@@ -792,6 +792,9 @@ void InspectorPanel::Update(
|
||||
|
||||
RefreshPresentation(context, subjectChanged);
|
||||
ApplyColorPickerToolValue(context);
|
||||
RebuildScrollableLayout();
|
||||
|
||||
const std::vector<UIRect> popupBounds = CollectInteractiveOverlayBounds();
|
||||
|
||||
const std::vector<UIInputEvent> filteredEvents =
|
||||
BuildUIEditorPanelInputEvents(
|
||||
@@ -812,7 +815,8 @@ void InspectorPanel::Update(
|
||||
HasActivePointerCapture()
|
||||
},
|
||||
dispatchEntry.focusGained,
|
||||
dispatchEntry.focusLost);
|
||||
dispatchEntry.focusLost,
|
||||
popupBounds.empty() ? nullptr : &popupBounds);
|
||||
TryClaimHostedPanelCommandFocus(
|
||||
m_commandFocusService,
|
||||
EditorActionRoute::Inspector,
|
||||
@@ -820,7 +824,6 @@ void InspectorPanel::Update(
|
||||
m_bounds,
|
||||
dispatchEntry.allowInteraction);
|
||||
|
||||
RebuildScrollableLayout();
|
||||
const UIRect scrollViewportBounds = BuildScrollViewportBounds();
|
||||
if (scrollViewportBounds.width > 0.0f && scrollViewportBounds.height > 0.0f) {
|
||||
m_scrollInteractionState.scrollViewState.focused =
|
||||
@@ -951,7 +954,8 @@ void InspectorPanel::Append(UIDrawList& drawList) const {
|
||||
::XCEngine::UI::Editor::GetUIEditorFixedPropertyGridMetrics(),
|
||||
{},
|
||||
{},
|
||||
m_textMeasurer);
|
||||
m_textMeasurer,
|
||||
false);
|
||||
}
|
||||
|
||||
if (ShouldShowAddComponentButton()) {
|
||||
@@ -985,6 +989,71 @@ void InspectorPanel::Append(UIDrawList& drawList) const {
|
||||
drawList.PopClipRect();
|
||||
}
|
||||
|
||||
void InspectorPanel::AppendOverlay(UIDrawList& drawList) const {
|
||||
if (!m_visible) {
|
||||
return;
|
||||
}
|
||||
|
||||
Widgets::UIEditorMenuPopupLayout popupLayout = {};
|
||||
Widgets::UIEditorMenuPopupState popupState = {};
|
||||
std::vector<Widgets::UIEditorMenuPopupItem> popupItems = {};
|
||||
if (!BuildPropertyGridPopupRuntime(popupLayout, popupState, popupItems)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const Widgets::UIEditorMenuPopupMetrics& popupMetrics =
|
||||
ResolveUIEditorMenuPopupMetrics();
|
||||
const Widgets::UIEditorMenuPopupPalette& popupPalette =
|
||||
ResolveUIEditorMenuPopupPalette();
|
||||
Widgets::AppendUIEditorMenuPopupBackground(
|
||||
drawList,
|
||||
popupLayout,
|
||||
popupItems,
|
||||
popupState,
|
||||
popupPalette,
|
||||
popupMetrics);
|
||||
Widgets::AppendUIEditorMenuPopupForeground(
|
||||
drawList,
|
||||
popupLayout,
|
||||
popupItems,
|
||||
popupState,
|
||||
popupPalette,
|
||||
popupMetrics);
|
||||
}
|
||||
|
||||
std::vector<UIRect> InspectorPanel::CollectInteractiveOverlayBounds() const {
|
||||
Widgets::UIEditorMenuPopupLayout popupLayout = {};
|
||||
Widgets::UIEditorMenuPopupState popupState = {};
|
||||
std::vector<Widgets::UIEditorMenuPopupItem> popupItems = {};
|
||||
if (!BuildPropertyGridPopupRuntime(popupLayout, popupState, popupItems) ||
|
||||
popupLayout.popupRect.width <= 0.0f ||
|
||||
popupLayout.popupRect.height <= 0.0f) {
|
||||
return {};
|
||||
}
|
||||
|
||||
return { popupLayout.popupRect };
|
||||
}
|
||||
|
||||
bool InspectorPanel::BuildPropertyGridPopupRuntime(
|
||||
Widgets::UIEditorMenuPopupLayout& popupLayout,
|
||||
Widgets::UIEditorMenuPopupState& popupState,
|
||||
std::vector<Widgets::UIEditorMenuPopupItem>& popupItems) const {
|
||||
if (!m_visible ||
|
||||
m_gridFrame.layout.bounds.width <= 0.0f ||
|
||||
m_gridFrame.layout.bounds.height <= 0.0f) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return Widgets::BuildUIEditorPropertyGridPopupRuntime(
|
||||
m_gridFrame.layout,
|
||||
m_presentation.sections,
|
||||
m_interactionState.propertyGridState,
|
||||
popupLayout,
|
||||
popupState,
|
||||
popupItems,
|
||||
ResolveUIEditorMenuPopupMetrics());
|
||||
}
|
||||
|
||||
UIEditorHostCommandEvaluationResult InspectorPanel::EvaluateEditCommand(
|
||||
std::string_view commandId) const {
|
||||
const InspectorPresentationComponentBinding* binding =
|
||||
|
||||
Reference in New Issue
Block a user