UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SSpacer.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreMinimal.h"
6#include "Misc/Attribute.h"
7#include "Layout/Visibility.h"
10
11class FPaintArgs;
13
14template <>
16{
17 static constexpr bool SupportsInvalidation() { return true; }
18};
19
20class SSpacer : public SLeafWidget
21{
23
24public:
25
31
34
36
42 SLATE_API void Construct( const FArguments& InArgs );
43
44 // SWidget interface
45 SLATE_API virtual int32 OnPaint( const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled ) const override;
46 // End of SWidget interface
47
49 {
50 if (bIsSpacerSizeBound)
51 {
52 SSpacer& MutableSelf = const_cast<SSpacer&>(*this);
53 MutableSelf.SpacerSize.UpdateNow(MutableSelf);
54 }
55 return SpacerSize.Get();
56 }
57
59 {
60 bIsSpacerSizeBound = InSpacerSize.IsBound();
61 SpacerSize.Assign(*this, InSpacerSize);
62 }
63
64protected:
65 //~ Begin SWidget overrides.
66 SLATE_API virtual FVector2D ComputeDesiredSize(float) const override;
67 //~ End SWidget overrides.
68
69private:
71 bool bIsSpacerSizeBound;
72};
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define SLATE_ATTRIBUTE(AttrType, AttrName)
Definition DeclarativeSyntaxSupport.h:192
#define SLATE_END_ARGS()
Definition DeclarativeSyntaxSupport.h:116
#define SLATE_DECLARE_WIDGET_API(WidgetType, ParentType, ModuleApiDefine)
Definition SlateControlledConstruction.h:22
uint32 Size
Definition VulkanMemory.cpp:4034
Definition PaintArgs.h:23
Definition SlateRect.h:26
Definition DrawElements.h:220
Definition WidgetStyle.h:15
Definition SLeafWidget.h:29
Definition SSpacer.h:21
SLATE_API void Construct(const FArguments &InArgs)
Definition SSpacer.cpp:19
void SetSize(TAttribute< FVector2D > InSpacerSize)
Definition SSpacer.h:58
virtual SLATE_API FVector2D ComputeDesiredSize(float) const override
Definition SSpacer.cpp:31
virtual SLATE_API int32 OnPaint(const FPaintArgs &Args, const FGeometry &AllottedGeometry, const FSlateRect &MyCullingRect, FSlateWindowElementList &OutDrawElements, int32 LayerId, const FWidgetStyle &InWidgetStyle, bool bParentEnabled) const override
Definition SSpacer.cpp:25
FVector2D GetSize() const
Definition SSpacer.h:48
SLATE_BEGIN_ARGS(SSpacer)
Definition SSpacer.h:26
Definition Attribute.h:17
static SLATECORE_API const EVisibility SelfHitTestInvisible
Definition Visibility.h:26
Definition Geometry.h:40
static constexpr bool SupportsInvalidation()
Definition SSpacer.h:17
Definition SWidget.h:69