12#include "CoreMinimal.h"
13#include "Widgets/WSButtonBase.h"
14#include "Widgets/Basic/WSText.h"
15#include "Components/HorizontalBox.h"
16#include "Components/Image.h"
17#include "Components/InvalidationBox.h"
18#include "Components/Overlay.h"
19#include "Components/ScaleBox.h"
20#include "Components/SizeBox.h"
22#include "WSModernSwitch.generated.h"
25enum class ELabelPlacement : uint8
27 Hide UMETA(DisplayName=
"Hide"),
28 Left UMETA(DisplayName=
"Left"),
29 Right UMETA(DisplayName=
"Right"),
31 LabelPlacement_Max UMETA(Hidden),
44 virtual TSharedRef<SWidget> RebuildWidget()
override;
45 virtual int32 NativePaint(
const FPaintArgs& Args,
const FGeometry& AllottedGeometry,
const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId,
const FWidgetStyle& InWidgetStyle,
bool bParentEnabled)
const override;
46 virtual void SynchronizeProperties()
override;
47 virtual void InitializeStyling()
override;
48 virtual void UpdateStyling()
override;
52 UPROPERTY(BlueprintReadOnly, Category =
"Widgets")
53 UInvalidationBox* Retainer =
nullptr;
55 UPROPERTY(BlueprintReadOnly, Category =
"Widgets")
56 UHorizontalBox* HBox =
nullptr;
58 UPROPERTY(BlueprintReadOnly, Category =
"Widgets")
59 UOverlay* Overlay =
nullptr;
61 UPROPERTY(BlueprintReadOnly, Category =
"Widgets")
62 USizeBox* TrackSizeBox =
nullptr;
64 UPROPERTY(BlueprintReadOnly, Category =
"Widgets")
65 UScaleBox* TrackScaleBox =
nullptr;
67 UPROPERTY(BlueprintReadOnly, Category =
"Widgets")
68 UOverlay* TrackOverlay =
nullptr;
70 UPROPERTY(BlueprintReadOnly, Category =
"Widgets")
71 UImage* TrackDropShadow =
nullptr;
73 UPROPERTY(BlueprintReadOnly, Category =
"Widgets")
74 UImage* Track =
nullptr;
76 UPROPERTY(BlueprintReadOnly, Category =
"Widgets")
77 UScaleBox* HandleScaleBox =
nullptr;
79 UPROPERTY(BlueprintReadOnly, Category =
"Widgets")
80 UOverlay* HandleOverlay =
nullptr;
82 UPROPERTY(BlueprintReadOnly, Category =
"Widgets")
83 UImage* HandleDropShadow =
nullptr;
85 UPROPERTY(BlueprintReadOnly, Category =
"Widgets")
86 UImage* Handle =
nullptr;
88 UPROPERTY(BlueprintReadOnly, Category =
"Widgets")
96 UPROPERTY(EditAnywhere, Category =
"Widget Studio|Advanced|Deprecated",Meta=(DeprecatedProperty, DeprecationMessage=
"Per-widget labeling is no longer supported. Place this widget in the Label Widget instead."))
97 ELabelPlacement LabelPlacement = ELabelPlacement::Hide;
100 UPROPERTY(EditAnywhere, Category =
"Widget Studio|Advanced|Deprecated",Meta=(DeprecatedProperty, DeprecationMessage=
"Per-widget labeling is no longer supported. Place this widget in the Label Widget instead."))
101 FText Label = FText().FromString(
"Switch");
104 UPROPERTY(EditAnywhere, Category=
"Widget Studio|Color")
105 EPalette TrackColor = EPalette::TertiaryBackground;
108 UPROPERTY(EditAnywhere, Category=
"Widget Studio|Color")
109 EPalette HandleColor = EPalette::PrimaryAccent;
112 UPROPERTY(EditAnywhere, Category=
"Widget Studio|Color", Meta = (EditCondition=
"LabelPlacement != ELabelPlacement::Hide", EditConditionHides))
113 EPalette LabelColor = EPalette::PrimaryBackground;
120 UFUNCTION(BlueprintPure, Category =
"Widget Studio|Advanced|Deprecated",Meta=(DeprecatedProperty, DeprecationMessage=
"Per-widget labeling is no longer supported. Place this widget in the Label Widget instead."))
121 FText GetLabel()
const;
124 UFUNCTION(BlueprintPure, Category =
"Widget Studio|Advanced|Deprecated",Meta=(DeprecatedProperty, DeprecationMessage=
"Per-widget labeling is no longer supported. Place this widget in the Label Widget instead."))
125 bool IsLabelVisible()
const;
128 UFUNCTION(BlueprintPure, Category=
"Widget Studio|Helper")
129 EPalette GetTrackColor()
const;
132 UFUNCTION(BlueprintPure, Category=
"Widget Studio|Helper")
133 EPalette GetHandleColor()
const;
136 UFUNCTION(BlueprintPure, Category =
"Widget Studio|Advanced|Deprecated",Meta=(DeprecatedProperty, DeprecationMessage=
"Per-widget labeling is no longer supported. Place this widget in the Label Widget instead."))
137 EPalette GetLabelColor()
const;
142 UFUNCTION(BlueprintCallable, Category =
"Widget Studio|Advanced|Deprecated",Meta=(DeprecatedProperty, DeprecationMessage=
"Per-widget labeling is no longer supported. Place this widget in the Label Widget instead."))
143 void SetLabelPlacement(
const ELabelPlacement NewPlacement);
146 UFUNCTION(BlueprintCallable, Category =
"Widget Studio|Advanced|Deprecated",Meta=(DeprecatedProperty, DeprecationMessage=
"Per-widget labeling is no longer supported. Place this widget in the Label Widget instead."))
147 void SetLabel(FText NewLabel);
153 UFUNCTION(BlueprintCallable, Category=
"Widget Studio|Modifier")
154 void SetTrackColor(EPalette NewColor);
160 UFUNCTION(BlueprintCallable, Category=
"Widget Studio|Modifier")
161 void SetHandleColor(EPalette NewColor);
164 UFUNCTION(BlueprintCallable, Category =
"Widget Studio|Advanced|Deprecated",Meta=(DeprecatedProperty, DeprecationMessage=
"Per-widget labeling is no longer supported. Place this widget in the Label Widget instead."))
165 void SetLabelColor(EPalette NewColor);
A custom text widget setup to work with the Typography Styling.
Definition: WSText.h:92