You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UE-114425 #preflight 60b8b26c30b9950001a58956 [CL 16546209 by Patrick Boutot in ue5-main branch]
68 lines
1.5 KiB
C++
68 lines
1.5 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "Components/ScrollBoxSlot.h"
|
|
#include "Components/Widget.h"
|
|
|
|
/////////////////////////////////////////////////////
|
|
// UScrollBoxSlot
|
|
|
|
UScrollBoxSlot::UScrollBoxSlot(const FObjectInitializer& ObjectInitializer)
|
|
: Super(ObjectInitializer)
|
|
, Slot(nullptr)
|
|
{
|
|
HorizontalAlignment = HAlign_Fill;
|
|
VerticalAlignment = VAlign_Fill;
|
|
}
|
|
|
|
void UScrollBoxSlot::BuildSlot(TSharedRef<SScrollBox> ScrollBox)
|
|
{
|
|
ScrollBox->AddSlot()
|
|
.Padding(Padding)
|
|
.HAlign(HorizontalAlignment)
|
|
.VAlign(VerticalAlignment)
|
|
.Expose(Slot)
|
|
[
|
|
Content == nullptr ? SNullWidget::NullWidget : Content->TakeWidget()
|
|
];
|
|
}
|
|
|
|
void UScrollBoxSlot::SetPadding(FMargin InPadding)
|
|
{
|
|
Padding = InPadding;
|
|
if ( Slot )
|
|
{
|
|
Slot->SetPadding(InPadding);
|
|
}
|
|
}
|
|
|
|
void UScrollBoxSlot::SetHorizontalAlignment(EHorizontalAlignment InHorizontalAlignment)
|
|
{
|
|
HorizontalAlignment = InHorizontalAlignment;
|
|
if ( Slot )
|
|
{
|
|
Slot->SetHorizontalAlignment(InHorizontalAlignment);
|
|
}
|
|
}
|
|
|
|
void UScrollBoxSlot::SetVerticalAlignment(EVerticalAlignment InVerticalAlignment)
|
|
{
|
|
VerticalAlignment = InVerticalAlignment;
|
|
if (Slot)
|
|
{
|
|
Slot->SetVerticalAlignment(InVerticalAlignment);
|
|
}
|
|
}
|
|
|
|
void UScrollBoxSlot::SynchronizeProperties()
|
|
{
|
|
SetPadding(Padding);
|
|
SetHorizontalAlignment(HorizontalAlignment);
|
|
SetVerticalAlignment(VerticalAlignment);
|
|
}
|
|
|
|
void UScrollBoxSlot::ReleaseSlateResources(bool bReleaseChildren)
|
|
{
|
|
Super::ReleaseSlateResources(bReleaseChildren);
|
|
Slot = nullptr;
|
|
}
|