You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rnx #rb none #ROBOMERGE-OWNER: ryan.durand #ROBOMERGE-AUTHOR: ryan.durand #ROBOMERGE-SOURCE: CL 10869210 via CL 10869511 via CL 10869900 #ROBOMERGE-BOT: (v613-10869866) [CL 10870549 by ryan durand in Main branch]
71 lines
1.6 KiB
C++
71 lines
1.6 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "Components/ScaleBoxSlot.h"
|
|
#include "Widgets/SNullWidget.h"
|
|
#include "Components/Widget.h"
|
|
#include "Widgets/Layout/SScaleBox.h"
|
|
|
|
/////////////////////////////////////////////////////
|
|
// UScaleBoxSlot
|
|
|
|
UScaleBoxSlot::UScaleBoxSlot(const FObjectInitializer& ObjectInitializer)
|
|
: Super(ObjectInitializer)
|
|
{
|
|
Padding = FMargin(0, 0);
|
|
|
|
HorizontalAlignment = HAlign_Center;
|
|
VerticalAlignment = VAlign_Center;
|
|
}
|
|
|
|
void UScaleBoxSlot::ReleaseSlateResources(bool bReleaseChildren)
|
|
{
|
|
Super::ReleaseSlateResources(bReleaseChildren);
|
|
|
|
ScaleBox.Reset();
|
|
}
|
|
|
|
void UScaleBoxSlot::BuildSlot(TSharedRef<SScaleBox> InScaleBox)
|
|
{
|
|
ScaleBox = InScaleBox;
|
|
|
|
//ScaleBox->SetPadding(Padding);
|
|
ScaleBox.Pin()->SetHAlign(HorizontalAlignment);
|
|
ScaleBox.Pin()->SetVAlign(VerticalAlignment);
|
|
|
|
ScaleBox.Pin()->SetContent(Content ? Content->TakeWidget() : SNullWidget::NullWidget);
|
|
}
|
|
|
|
void UScaleBoxSlot::SetPadding(FMargin InPadding)
|
|
{
|
|
Padding = InPadding;
|
|
if ( ScaleBox.IsValid() )
|
|
{
|
|
//ScaleBox.Pin()->SetPadding(InPadding);
|
|
}
|
|
}
|
|
|
|
void UScaleBoxSlot::SetHorizontalAlignment(EHorizontalAlignment InHorizontalAlignment)
|
|
{
|
|
HorizontalAlignment = InHorizontalAlignment;
|
|
if ( ScaleBox.IsValid() )
|
|
{
|
|
ScaleBox.Pin()->SetHAlign(InHorizontalAlignment);
|
|
}
|
|
}
|
|
|
|
void UScaleBoxSlot::SetVerticalAlignment(EVerticalAlignment InVerticalAlignment)
|
|
{
|
|
VerticalAlignment = InVerticalAlignment;
|
|
if ( ScaleBox.IsValid() )
|
|
{
|
|
ScaleBox.Pin()->SetVAlign(InVerticalAlignment);
|
|
}
|
|
}
|
|
|
|
void UScaleBoxSlot::SynchronizeProperties()
|
|
{
|
|
SetPadding(Padding);
|
|
SetHorizontalAlignment(HorizontalAlignment);
|
|
SetVerticalAlignment(VerticalAlignment);
|
|
}
|