You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#rb sebatian.nordgren #preflight 627d28dc4a05ef0394cc5375 #ROBOMERGE-AUTHOR: patrick.boutot #ROBOMERGE-SOURCE: CL 20222541 via CL 20222575 via CL 20222581 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690) [CL 20225020 by patrick boutot in ue5-main branch]
78 lines
1.4 KiB
C++
78 lines
1.4 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "Components/Spacer.h"
|
|
#include "Widgets/DeclarativeSyntaxSupport.h"
|
|
#include "Widgets/Layout/SSpacer.h"
|
|
|
|
#define LOCTEXT_NAMESPACE "UMG"
|
|
|
|
/////////////////////////////////////////////////////
|
|
// USpacer
|
|
|
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
|
USpacer::USpacer(const FObjectInitializer& ObjectInitializer)
|
|
: Super(ObjectInitializer)
|
|
, Size(1.0f, 1.0f)
|
|
{
|
|
bIsVariable = false;
|
|
SetVisibilityInternal(ESlateVisibility::SelfHitTestInvisible);
|
|
}
|
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
|
|
|
void USpacer::ReleaseSlateResources(bool bReleaseChildren)
|
|
{
|
|
Super::ReleaseSlateResources(bReleaseChildren);
|
|
|
|
MySpacer.Reset();
|
|
}
|
|
|
|
PRAGMA_DISABLE_DEPRECATION_WARNINGS
|
|
FVector2D USpacer::GetSize() const
|
|
{
|
|
if (MySpacer.IsValid())
|
|
{
|
|
return MySpacer->GetSize();
|
|
}
|
|
|
|
return Size;
|
|
}
|
|
|
|
void USpacer::SetSize(FVector2D InSize)
|
|
{
|
|
Size = InSize;
|
|
|
|
if ( MySpacer.IsValid() )
|
|
{
|
|
MySpacer->SetSize(InSize);
|
|
}
|
|
}
|
|
|
|
TSharedRef<SWidget> USpacer::RebuildWidget()
|
|
{
|
|
MySpacer = SNew(SSpacer)
|
|
.Size(Size);
|
|
|
|
return MySpacer.ToSharedRef();
|
|
}
|
|
|
|
void USpacer::SynchronizeProperties()
|
|
{
|
|
Super::SynchronizeProperties();
|
|
|
|
MySpacer->SetSize(Size);
|
|
}
|
|
PRAGMA_ENABLE_DEPRECATION_WARNINGS
|
|
|
|
#if WITH_EDITOR
|
|
|
|
const FText USpacer::GetPaletteCategory()
|
|
{
|
|
return LOCTEXT("Primitive", "Primitive");
|
|
}
|
|
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////
|
|
|
|
#undef LOCTEXT_NAMESPACE
|