UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SColorBlock.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 "Input/Reply.h"
10#include "Styling/AppStyle.h"
11
12class FPaintArgs;
14
16{
17 // Draw a single block that draws color and opacity as one. I.E the entire block will be semi-transparent if opacity < 1
19 // The color block is split into in half. The left half draws the color with opacity and the right half draws without any opacity
21 // The color block is split into in half. The left half draws the color without any opacity and the right half draws with opacity
23 // Alpha is omitted from display
24 Ignore,
25};
26
27
28template <>
30{
31 static constexpr bool SupportsInvalidation() { return true; }
32};
33
35{
37
38public:
39
51
54
55
56 SLATE_ATTRIBUTE(const FSlateBrush*, AlphaBackgroundBrush)
57
58
59 SLATE_ATTRIBUTE(FVector4, CornerRadius)
60
61
62 SLATE_ATTRIBUTE(bool, ColorIsHSV)
63
64
65 SLATE_ATTRIBUTE(bool, ShowBackgroundForAlpha)
66
67
69
70
72
73
75
76
77 SLATE_EVENT(FPointerEventHandler, OnMouseButtonDown)
78
80
81public:
84
90 SLATE_API void Construct(const FArguments& InArgs);
91
93 // SWidget overrides
94 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;
96 SLATE_API virtual FVector2D ComputeDesiredSize(float) const override;
97
98 void MakeSection(TArray<FSlateGradientStop>& OutGradientStops, FVector2D StartPt, FVector2D EndPt, FLinearColor Color, const FWidgetStyle& InWidgetStyle, bool bIgnoreAlpha) const;
99
100private:
103
104 TSlateAttribute<const FSlateBrush*> AlphaBackgroundBrush;
105
106 TSlateAttribute<FVector4> GradientCornerRadius;
107
108 TSlateAttribute<FVector2D> ColorBlockSize;
109
111 FPointerEventHandler MouseButtonDownHandler;
112
115
117 TSlateAttribute<bool> ColorIsHSV;
118
120 TSlateAttribute<bool> ShowBackgroundForAlpha;
121
123 TSlateAttribute<bool> bUseSRGB;
124};
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_EVENT(DelegateName, EventName)
Definition DeclarativeSyntaxSupport.h:458
#define SLATE_END_ARGS()
Definition DeclarativeSyntaxSupport.h:116
return true
Definition ExternalRpcRegistry.cpp:601
EColorBlockAlphaDisplayMode
Definition SColorBlock.h:16
SColorThemeBar is deprecated SColorThemesViewer now displays a standard menu with a list of available themes _UseSRGB()
#define SLATE_DECLARE_WIDGET_API(WidgetType, ParentType, ModuleApiDefine)
Definition SlateControlledConstruction.h:22
uint32 Size
Definition VulkanMemory.cpp:4034
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition AppStyle.h:24
Definition PaintArgs.h:23
Definition Reply.h:24
Definition SlateRect.h:26
Definition DrawElements.h:220
Definition WidgetStyle.h:15
Definition SColorBlock.h:35
SLATE_BEGIN_ARGS(SColorBlock)
Definition SColorBlock.h:40
SLATE_API void Construct(const FArguments &InArgs)
Definition SColorBlock.cpp:41
Definition SLeafWidget.h:29
Definition Array.h:670
@ false
Definition radaudio_common.h:23
Definition Geometry.h:40
Definition Color.h:48
Definition Events.h:695
Definition SlateBrush.h:239
Definition DrawElementTypes.h:395
Definition SWidget.h:189
static constexpr bool SupportsInvalidation()
Definition SColorBlock.h:31
Definition SWidget.h:69