UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
STabDrawer.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
9
10struct FSplitterStyle;
11
12class STabDrawer;
13class SDockTab;
14
17{
19 Left,
20
22 Right,
23
25 Bottom
26};
27
31
36{
38 {
40 _ShadowOffset = FVector2D(8.0f, 8.0f);
41 }
42 SLATE_DEFAULT_SLOT(FArguments, Content)
44 SLATE_ARGUMENT(float, MinDrawerSize)
46 SLATE_ARGUMENT(float, MaxDrawerSize)
48 SLATE_ARGUMENT(float, TargetDrawerSize)
50 SLATE_EVENT(FOnDrawerTargetSizeChanged, OnTargetDrawerSizeChanged)
52 SLATE_EVENT(FOnDrawerFocusLost, OnDrawerFocusLost)
54 SLATE_EVENT(FOnDrawerClosed, OnDrawerClosed)
56 SLATE_ARGUMENT(FVector2D, ShadowOffset)
58
61
63 void SetCurrentSize(float InSize);
64
70 void Open(bool bAnimateOpen=true);
71
73 void Close();
74
76 bool IsOpen() const;
77
79 bool IsClosing() const;
80
82 const TSharedRef<SDockTab> GetTab() const;
83
85 virtual bool SupportsKeyboardFocus() const override;
86 virtual FVector2D ComputeDesiredSize(float LayoutScaleMultiplier) const override;
87 virtual void OnArrangeChildren(const FGeometry& AllottedGeometry, FArrangedChildren& ArrangedChildren) const override;
88 virtual FReply OnMouseButtonDown(const FGeometry& AllottedGeometry, const FPointerEvent& MouseEvent) override;
89 virtual FReply OnMouseButtonUp(const FGeometry& AllottedGeometry, const FPointerEvent& MouseEvent) override;
90 virtual FReply OnMouseMove(const FGeometry& AllottedGeometry, const FPointerEvent& MouseEvent) override;
91 virtual void OnMouseLeave(const FPointerEvent& MouseEvent) override;
92 virtual FCursorReply OnCursorQuery(const FGeometry& MyGeometry, const FPointerEvent& CursorEvent) const override;
93 virtual int32 OnPaint(const FPaintArgs& Args, const FGeometry& AllottedGeometry, const FSlateRect& MyCullingRect, FSlateWindowElementList& OutDrawElements, int32 LayerId, const FWidgetStyle& InWidgetStyle, bool bParentEnabled) const override;
94
95private:
96 FGeometry GetRenderTransformedGeometry(const FGeometry& AllottedGeometry) const;
97 FGeometry GetResizeHandleGeometry(const FGeometry& AllottedGeometry) const;
98 EActiveTimerReturnType UpdateAnimation(double CurrentTime, float DeltaTime);
99 void OnGlobalFocusChanging(const FFocusEvent& FocusEvent, const FWeakWidgetPath& OldFocusedWidgetPath, const TSharedPtr<SWidget>& OldFocusedWidget, const FWidgetPath& NewFocusedWidgetPath, const TSharedPtr<SWidget>& NewFocusedWidget);
101
102private:
103 FGeometry InitialResizeGeometry;
104 FOnDrawerTargetSizeChanged OnTargetDrawerSizeChanged;
105 FOnDrawerFocusLost OnDrawerFocusLost;
106 FOnDrawerClosed OnDrawerClosed;
107 TSharedPtr<FActiveTimerHandle> OpenCloseTimer;
109 TWeakPtr<SWidget> TabButton;
110 FThrottleRequest ResizeThrottleHandle;
111 FThrottleRequest AnimationThrottle;
112 FCurveSequence OpenCloseAnimation;
113 const FSlateBrush* BackgroundBrush;
114 const FSlateBrush* ShadowBrush;
115 const FSlateBrush* BorderBrush; // border with all corners rounded
116 const FSlateBrush* BorderSquareEdgeBrush; // border with corners squared on one edge depending on open direction
117 const FSplitterStyle* SplitterStyle;
118 FVector2D ShadowOffset;
119 float ExpanderSize;
120 float CurrentSize;
121 float MinDrawerSize;
122 float MaxDrawerSize;
123 float TargetDrawerSize;
124 float InitialSizeAtResize;
125 ETabDrawerOpenDirection OpenDirection;
126 bool bIsResizing;
127 bool bIsResizeHandleHovered;
128};
129
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_BEGIN_ARGS(InWidgetType)
Definition DeclarativeSyntaxSupport.h:63
#define SLATE_EVENT(DelegateName, EventName)
Definition DeclarativeSyntaxSupport.h:458
#define SLATE_END_ARGS()
Definition DeclarativeSyntaxSupport.h:116
#define SLATE_DEFAULT_SLOT(DeclarationType, SlotName)
Definition DeclarativeSyntaxSupport.h:444
#define SLATE_ARGUMENT(ArgType, ArgName)
Definition DeclarativeSyntaxSupport.h:208
#define DECLARE_DELEGATE_TwoParams(DelegateName, Param1Type, Param2Type)
Definition DelegateCombinations.h:57
#define DECLARE_DELEGATE_OneParam(DelegateName, Param1Type)
Definition DelegateCombinations.h:48
UE::Math::TVector2< double > FVector2D
Definition MathFwd.h:48
ETabDrawerOpenDirection
Definition STabDrawer.h:17
EActiveTimerReturnType
Definition SlateEnums.h:329
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition ArrangedChildren.h:15
Definition CursorReply.h:16
Definition PaintArgs.h:23
Definition Reply.h:24
Definition SlateRect.h:26
Definition DrawElements.h:220
Definition ThrottleManager.h:14
Definition WidgetPath.h:213
Definition WidgetPath.h:51
Definition WidgetStyle.h:15
Definition SCompoundWidget.h:22
Definition SDockTab.h:55
Definition STabDrawer.h:36
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition SharedPointer.h:1295
Definition CurveSequence.h:26
Definition Events.h:51
Definition Geometry.h:40
Definition Events.h:695
Definition SlateBrush.h:239
Definition SlateTypes.h:1575