Working on new root canvas stuff
This commit is contained in:
@@ -54,6 +54,18 @@ int32 UlxRootCanvasPanel::GetMaxZOrder() const
|
||||
return MaxZOrder;
|
||||
}
|
||||
|
||||
void UlxRootCanvasPanel::PropagateZOrderToSlate()
|
||||
{
|
||||
if (!MustPropagateZOrderToSlate) return;
|
||||
MustPropagateZOrderToSlate = false;
|
||||
for (UPanelSlot *PanelSlot : Slots)
|
||||
{
|
||||
UlxRootCanvasSlot *TypedSlot = Cast<UlxRootCanvasSlot>(PanelSlot);
|
||||
check(TypedSlot);
|
||||
TypedSlot->SetZOrder(TypedSlot->GetZOrder());
|
||||
}
|
||||
}
|
||||
|
||||
TArray<UlxRootCanvasSlot*> UlxRootCanvasPanel::GetSortedUserWidgets()
|
||||
{
|
||||
TArray<UlxRootCanvasSlot*> Result;
|
||||
@@ -95,7 +107,15 @@ void UlxRootCanvasPanel::SetWidgetWindowManagement(class UUserWidget *Widget,
|
||||
Widget->SetDesiredFocusWidget(DesiredFocusWidget);
|
||||
if (BringToFront)
|
||||
{
|
||||
Slot->SetZOrder(Panel->GetMaxZOrder() + 1);
|
||||
// Write the int32 ZOrder UPROPERTY directly and defer the
|
||||
// Slate-side push to PropagateZOrderToSlate. Going through SetZOrder
|
||||
// here is unsafe when called from Event Construct: the FSlot
|
||||
// has been Exposed but its Owner isn't set yet, which fires
|
||||
// an ensure in SConstraintCanvas::FSlot::SetZOrder.
|
||||
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
||||
Slot->ZOrder = Panel->GetMaxZOrder() + 1;
|
||||
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
||||
Panel->MustPropagateZOrderToSlate = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user