You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
71 lines
1.6 KiB
C++
71 lines
1.6 KiB
C++
// Copyright 1998-2017 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->SetHAlign(HorizontalAlignment);
|
|
ScaleBox->SetVAlign(VerticalAlignment);
|
|
|
|
ScaleBox->SetContent(Content ? Content->TakeWidget() : SNullWidget::NullWidget);
|
|
}
|
|
|
|
void UScaleBoxSlot::SetPadding(FMargin InPadding)
|
|
{
|
|
Padding = InPadding;
|
|
if ( ScaleBox.IsValid() )
|
|
{
|
|
//ScaleBox->SetPadding(InPadding);
|
|
}
|
|
}
|
|
|
|
void UScaleBoxSlot::SetHorizontalAlignment(EHorizontalAlignment InHorizontalAlignment)
|
|
{
|
|
HorizontalAlignment = InHorizontalAlignment;
|
|
if ( ScaleBox.IsValid() )
|
|
{
|
|
ScaleBox->SetHAlign(InHorizontalAlignment);
|
|
}
|
|
}
|
|
|
|
void UScaleBoxSlot::SetVerticalAlignment(EVerticalAlignment InVerticalAlignment)
|
|
{
|
|
VerticalAlignment = InVerticalAlignment;
|
|
if ( ScaleBox.IsValid() )
|
|
{
|
|
ScaleBox->SetVAlign(InVerticalAlignment);
|
|
}
|
|
}
|
|
|
|
void UScaleBoxSlot::SynchronizeProperties()
|
|
{
|
|
SetPadding(Padding);
|
|
SetHorizontalAlignment(HorizontalAlignment);
|
|
SetVerticalAlignment(VerticalAlignment);
|
|
}
|