UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
SDockTab.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/Margin.h"
8#include "Layout/Visibility.h"
10#include "Styling/SlateColor.h"
11#include "Input/Reply.h"
12#include "Widgets/SWidget.h"
17
19class SDockingArea;
21class SDockingTabWell;
22class SImage;
23class STextBlock;
24class SToolTip;
25
35
42
43class FMenuBuilder;
44
45namespace UE::Slate::Private
46{
47 class STabPanelDrawer;
48}
49
54class SDockTab : public SBorder
55{
56 friend class FTabManager;
57 friend class STabSidebar;
59
60public:
61
64
67
70
73
76
79
101
102 SLATE_DEFAULT_SLOT( FArguments, Content )
105 SLATE_ATTRIBUTE( FMargin, ContentPadding )
107 SLATE_ATTRIBUTE( FText, Label )
109 UE_DEPRECATED(5.0, "Tab icons are now being managed by tab spawners and toolkits. In the rare case you need to set an icon manually, use SetTabIcon() instead")
110 FArguments& Icon(const FSlateBrush* InIcon)
111 {
112 return Me();
113 }
114
127 SLATE_EVENT( FSimpleDelegate, OnTabDrawerClosed)
129 SLATE_ATTRIBUTE( FSlateColor, ForegroundColor )
133
134
135
136
137 SLATE_API void Construct( const FArguments& InArgs );
138
139 // SWidget interface
149 // End of SWidget interface
150
151 // SBorder interface
153 // End of SBorder interface
154
161
163 SLATE_API bool IsActive() const;
164
166 SLATE_API bool IsForeground() const;
167
170
172 SLATE_API void ExtendContextMenu(FMenuBuilder& MenuBuilder);
173
176
179
185
188
194
197
200
203
206
209
212
215
218
220 SLATE_API float GetOverlapWidth() const;
221
224
227
230
233
236
239
241 SLATE_API const FSlateBrush* GetTabIcon() const;
242
245
247 SLATE_API bool ShouldAutosize() const;
248
251
253 SLATE_API bool CanCloseTab() const;
254
256 SLATE_API bool CanCloseTab(bool bIgnoreLockedTabs) const;
257
260
262 SLATE_API bool IsTabLocked() const;
263
266
272
275
281
284
290
293
296
299
302
305
308
311
314
317
319 UE_DEPRECATED(5.0, "The tab manager is not guaranteed to exist, which will cause GetTabManager() to crash. Use GetTabManagerPtr() instead.")
320 SLATE_API TSharedRef<FTabManager> GetTabManager() const;
321
324
327
330
333
335 SLATE_API void FlashTab();
336
339
348 SLATE_API bool HasSiblingTab(const FTabId& SiblingTabId, const bool TreatIndexNoneAsWildcard = true) const;
349
352
355 {
356 return LastActivationTime;
357 }
358
360
362 SLATE_API bool IsTabNameHidden() const;
363
364protected:
367
370
372 SLATE_API const FSlateBrush* GetImageBrush() const;
373
376
379
382
385
388
391
394
397
400
402 SLATE_API void SetLayoutIdentifier( const FTabId& TabId );
403
406
409
412
413private:
415 SLATE_API void SetIsTabNameHidden(bool bInIsTabNameHidden);
416
418 SLATE_API EActiveTimerReturnType TriggerActivateTab( double InCurrentTime, float InDeltaTime );
419
420 SLATE_API EActiveTimerReturnType OnHandleUpdateStyle(double InCurrentTime, float InDeltaTime);
421
422 SLATE_API void OnParentSet();
423
424 SLATE_API void UpdateTabStyle();
425
426 SLATE_API void OnTabDrawerOpened();
427 SLATE_API void OnTabDrawerClosed();
428
429 SLATE_API void NotifyTabRelocated();
430
431 /* Closes tab if permissions filter no longer allows this tab to be open. */
432 SLATE_API void CheckTabAllowed();
433
435 void RemoveTabFromParent_Internal();
436
438 TWeakPtr<FActiveTimerHandle> DragDropTimerHandle;
439 TWeakPtr<FActiveTimerHandle> UpdateStyleTimerHandle;
440
442 bool bIsTabNameHidden = false;
443protected:
444
447
453
456
459
462
465
468
471
474
477
480
483
486
488
490
492
494
496
502
505
509
511
514
517
520
523
526
529
531 SLATE_API float GetFlashValue() const;
532
535
539
542
545};
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define SLATE_NAMED_SLOT(DeclarationType, SlotName)
Definition DeclarativeSyntaxSupport.h:437
#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
#define SLATE_DEFAULT_SLOT(DeclarationType, SlotName)
Definition DeclarativeSyntaxSupport.h:444
#define SLATE_ARGUMENT(ArgType, ArgName)
Definition DeclarativeSyntaxSupport.h:208
return true
Definition ExternalRpcRegistry.cpp:601
ETabActivationCause
Definition SDockTab.h:38
@ SetDirectly
Definition SDockTab.h:40
@ UserClickedOnTab
Definition SDockTab.h:39
ETabRole
Definition SDockTab.h:28
@ MajorTab
Definition SDockTab.h:29
@ NomadTab
Definition SDockTab.h:31
@ PanelTab
Definition SDockTab.h:30
@ DocumentTab
Definition SDockTab.h:32
@ NumRoles
Definition SDockTab.h:33
EActiveTimerReturnType
Definition SlateEnums.h:329
ETextOverflowPolicy
Definition SlateTypes.h:79
uint8_t uint8
Definition binka_ue_file_header.h:8
Definition ActiveTimerHandle.h:12
Definition DragAndDrop.h:141
Definition MultiBoxBuilder.h:310
Definition UnrealType.h:3087
Definition Reply.h:24
Definition TabManager.h:431
Definition Text.h:385
Definition SBorder.h:31
Definition SDockTab.h:55
FTabId LayoutIdentifier
Definition SDockTab.h:455
TAttribute< FMargin > ContentAreaPadding
Definition SDockTab.h:510
SLATE_API void ProvideDefaultIcon(const FSlateBrush *InDefaultIcon)
Definition SDockTab.cpp:535
FSimpleDelegate OnTabDrawerOpenedEvent
Definition SDockTab.h:489
TSharedRef< SWidget > TabWellContentRight
Definition SDockTab.h:451
ETabRole TabRole
Definition SDockTab.h:458
DECLARE_DELEGATE_OneParam(FOnTabRenamed, TSharedRef< SDockTab >)
SLATE_API const FSlateBrush * GetContentAreaBrush() const
Definition SDockTab.cpp:299
SLATE_API void SetTabIcon(const TAttribute< const FSlateBrush * > InTabIcon)
Definition SDockTab.cpp:980
TSharedRef< SWidget > Content
Definition SDockTab.h:449
FCurveSequence SpawnAnimCurve
Definition SDockTab.h:525
virtual SLATE_API FReply OnTouchEnded(const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent) override
Definition SDockTab.cpp:179
virtual SLATE_API FReply OnMouseButtonDoubleClick(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
Definition SDockTab.cpp:64
SLATE_API TSharedRef< SWidget > GetTitleBarRightContent()
Definition SDockTab.cpp:324
bool bCanEverClose
Definition SDockTab.h:461
SLATE_API EVisibility GetActiveTabIndicatorVisibility() const
Definition SDockTab.cpp:879
SLATE_API const FTabId GetLayoutIdentifier() const
Definition SDockTab.cpp:339
SLATE_API void RemoveTabFromParent()
Definition SDockTab.cpp:371
SLATE_API float GetFlashValue() const
Definition SDockTab.cpp:555
SLATE_API void SetTabManager(const TSharedPtr< FTabManager > &InTabManager)
Definition SDockTab.cpp:436
SLATE_API void Construct(const FArguments &InArgs)
Definition SDockTab.cpp:584
SLATE_API bool IsTabNameHidden() const
Definition SDockTab.cpp:1145
SLATE_API void SetTitleBarRightContent(TSharedRef< SWidget > InContent)
Definition SDockTab.cpp:218
FOnTabActivatedCallback OnTabActivated
Definition SDockTab.h:482
TAttribute< FLinearColor > IconColor
Definition SDockTab.h:519
SLATE_API TSharedPtr< SWindow > GetParentWindow() const
Definition SDockTab.cpp:392
FCanCloseTab OnCanCloseTab
Definition SDockTab.h:485
SLATE_API void SetShouldAutosize(const bool bNewShouldAutosize)
Definition SDockTab.cpp:991
FSimpleDelegate OnTabDrawerClosedEvent
Definition SDockTab.h:487
SLATE_API FText GetTabLabel() const
Definition SDockTab.cpp:940
virtual SLATE_API void SetContent(TSharedRef< SWidget > InContent) override
Definition SDockTab.cpp:188
double LastActivationTime
Definition SDockTab.h:544
SLATE_API TSharedRef< SWidget > GetLeftContent()
Definition SDockTab.cpp:314
SLATE_API FSlateColor GetFlashColor() const
Definition SDockTab.cpp:922
SLATE_API FMargin GetContentPadding() const
Definition SDockTab.cpp:329
SLATE_API TOptional< FVector2D > GetTabIconSize() const
Definition SDockTab.cpp:1032
SLATE_API ETabRole GetTabRole() const
Definition SDockTab.cpp:263
virtual SLATE_API void OnDragLeave(const FDragDropEvent &DragDropEvent) override
Definition SDockTab.cpp:145
FOnTabClosedCallback OnTabClosed
Definition SDockTab.h:479
TAttribute< FText > TabLabelSuffix
Definition SDockTab.h:473
SLATE_API TSharedPtr< class SDockingArea > GetDockArea() const
Definition SDockTab.cpp:377
SLATE_API UE::Slate::FDeprecateVector2DResult GetAnimatedScale() const
Definition SDockTab.cpp:1111
TSharedPtr< STextBlock > LabelSuffix
Definition SDockTab.h:538
SLATE_API void SetParent(TSharedPtr< SDockingTabWell > Parent=TSharedPtr< SDockingTabWell >())
Definition SDockTab.cpp:344
SLATE_API bool IsActive() const
Definition SDockTab.cpp:228
SLATE_API void DrawAttention()
Definition SDockTab.cpp:517
SLATE_API void SetDraggedOverDockArea(const TSharedPtr< SDockingArea > &Area)
Definition SDockTab.cpp:572
SLATE_API void ExtendContextMenu(FMenuBuilder &MenuBuilder)
Definition SDockTab.cpp:917
SLATE_API const FSlateBrush * GetColorOverlayImageBrush() const
Definition SDockTab.cpp:870
SLATE_API TSharedPtr< SDockingTabWell > GetParent() const
Definition SDockTab.cpp:356
SLATE_API FMargin GetTabIconBorderPadding() const
Definition SDockTab.cpp:865
SLATE_API void SetOnTabRelocated(const FSimpleDelegate InDelegate)
Definition SDockTab.cpp:497
FOnTabRenamed OnTabRenamed
Definition SDockTab.h:504
FExtendContextMenu OnExtendContextMenu
Definition SDockTab.h:495
DECLARE_DELEGATE_OneParam(FExtendContextMenu, FMenuBuilder &)
TWeakPtr< SDockingTabWell > ParentPtr
Definition SDockTab.h:464
SLATE_API void PlaySpawnAnim()
Definition SDockTab.cpp:544
SLATE_API const FSlateBrush * GetTabIcon() const
Definition SDockTab.cpp:969
SLATE_API FSlateColor GetTabColor() const
Definition SDockTab.cpp:901
virtual SLATE_API FReply OnMouseButtonUp(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
Definition SDockTab.cpp:111
SLATE_BEGIN_ARGS(SDockTab)
Definition SDockTab.h:80
SLATE_API FText GetTabLabelSuffix() const
Definition SDockTab.cpp:951
SLATE_API const FSlateBrush * GetImageBrush() const
Definition SDockTab.cpp:840
SLATE_API void ProvideDefaultLabel(const FText &InDefaultLabel)
Definition SDockTab.cpp:526
SLATE_API FText GetCloseButtonToolTipText() const
Definition SDockTab.cpp:1003
TAttribute< FLinearColor > TabColorScale
Definition SDockTab.h:516
DECLARE_DELEGATE(FOnPersistVisualState)
SLATE_API TSharedPtr< SDockingTabStack > GetParentDockTabStack() const
Definition SDockTab.cpp:361
FSimpleDelegate OnTabDraggedOverDockArea
Definition SDockTab.h:493
SLATE_API const FSlateBrush * GetFlashOverlayImageBrush() const
Definition SDockTab.cpp:907
SLATE_API void UpdateActivationTime()
Definition SDockTab.cpp:1118
FOnPersistVisualState OnPersistVisualState
Definition SDockTab.h:501
SLATE_API void FlashTab()
Definition SDockTab.cpp:549
SLATE_API void SetOnTabActivated(const FOnTabActivatedCallback &InDelegate)
Definition SDockTab.cpp:477
SLATE_API void ActivateInParent(ETabActivationCause InActivationCause)
Definition SDockTab.cpp:418
virtual SLATE_API FSlateColor GetForegroundColor() const
Definition SDockTab.cpp:238
SLATE_API bool RequestCloseTab()
Definition SDockTab.cpp:1074
TAttribute< FText > TabLabel
Definition SDockTab.h:470
SLATE_API void SetOnTabDrawerOpened(const FSimpleDelegate InDelegate)
Definition SDockTab.cpp:487
SLATE_API bool IsTabLocked() const
Definition SDockTab.cpp:1099
SLATE_API void SetOnExtendContextMenu(const FExtendContextMenu &Handler)
Definition SDockTab.cpp:462
SLATE_API const FSlateBrush * GetTabWellBrush() const
Definition SDockTab.cpp:304
SLATE_API void SetLabel(const TAttribute< FText > &InTabLabel)
Definition SDockTab.cpp:945
const FDockTabStyle * MajorTabStyle
Definition SDockTab.h:507
virtual SLATE_API FReply OnDragDetected(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
Definition SDockTab.cpp:76
TWeakPtr< FTabManager > MyTabManager
Definition SDockTab.h:446
DECLARE_DELEGATE_RetVal(bool, FCanCloseTab)
virtual SLATE_API FReply OnTouchStarted(const FGeometry &MyGeometry, const FPointerEvent &InTouchEvent) override
Definition SDockTab.cpp:167
SLATE_API TSharedPtr< FTabManager > GetTabManagerPtr() const
Definition SDockTab.cpp:512
SLATE_API void SetTabLabelOverflowPolicy(TOptional< ETextOverflowPolicy > InOverflowPolicy) const
Definition SDockTab.cpp:961
SLATE_API void SetRightContent(TSharedRef< SWidget > InContent)
Definition SDockTab.cpp:208
DECLARE_DELEGATE_OneParam(FOnTabClosedCallback, TSharedRef< SDockTab >)
SLATE_API void SetCanCloseTab(const FCanCloseTab &InOnTabClosing)
Definition SDockTab.cpp:467
const FDockTabStyle * GenericTabStyle
Definition SDockTab.h:508
FSimpleDelegate OnTabRelocated
Definition SDockTab.h:491
SLATE_API void SetOnTabRenamed(const FOnTabRenamed &InDelegate)
Definition SDockTab.cpp:482
bool bShouldAutosize
Definition SDockTab.h:513
TSharedPtr< SDockingArea > DraggedOverDockingArea
Definition SDockTab.h:534
TSharedRef< SWidget > TitleBarContentRight
Definition SDockTab.h:452
FCurveSequence FlashTabCurve
Definition SDockTab.h:528
SLATE_API TSharedRef< SWidget > GetRightContent()
Definition SDockTab.cpp:319
double GetLastActivationTime()
Definition SDockTab.h:354
SLATE_API void SetLayoutIdentifier(const FTabId &TabId)
Definition SDockTab.cpp:334
DECLARE_DELEGATE_TwoParams(FOnTabActivatedCallback, TSharedRef< SDockTab >, ETabActivationCause)
SLATE_API void SetOnTabDrawerClosed(const FSimpleDelegate InDelegate)
Definition SDockTab.cpp:492
SLATE_API void SetParentDockTabStackTabWellHidden(bool bIsTabWellHidden)
Definition SDockTab.cpp:1127
void SetParentDockingArea(TSharedPtr< SDockingArea > Parent)
Definition SDockTab.cpp:351
SLATE_API void SetLeftContent(TSharedRef< SWidget > InContent)
Definition SDockTab.cpp:198
SLATE_API bool IsForeground() const
Definition SDockTab.cpp:233
SLATE_API void PersistVisualState()
Definition SDockTab.cpp:1105
TAttribute< const FSlateBrush * > TabIcon
Definition SDockTab.h:476
SLATE_API FSlateColor GetIconColor() const
Definition SDockTab.cpp:884
TSharedRef< SWidget > TabWellContentLeft
Definition SDockTab.h:450
SLATE_API EVisibility HandleIsCloseButtonVisible() const
Definition SDockTab.cpp:1024
SLATE_API void SetTabLabelSuffix(const TAttribute< FText > &InTabLabelSuffix)
Definition SDockTab.cpp:956
virtual SLATE_API FReply OnMouseButtonDown(const FGeometry &MyGeometry, const FPointerEvent &MouseEvent) override
Definition SDockTab.cpp:37
virtual SLATE_API void OnDragEnter(const FGeometry &MyGeometry, const FDragDropEvent &DragDropEvent) override
Definition SDockTab.cpp:132
SLATE_API void SetOnTabClosed(const FOnTabClosedCallback &InDelegate)
Definition SDockTab.cpp:472
virtual SLATE_API FReply OnDrop(const FGeometry &MyGeometry, const FDragDropEvent &DragDropEvent) override
Definition SDockTab.cpp:156
SLATE_API FReply OnCloseButtonClicked()
Definition SDockTab.cpp:996
SLATE_API FMargin GetTabPadding() const
Definition SDockTab.cpp:857
SLATE_API void SetTabToolTipWidget(TSharedPtr< SToolTip > InTabToolTipWidget)
Definition SDockTab.cpp:974
SLATE_API bool CanCloseTab() const
Definition SDockTab.cpp:1037
SLATE_API const FDockTabStyle & GetCurrentStyle() const
Definition SDockTab.cpp:830
SLATE_API ETabRole GetVisualTabRole() const
Definition SDockTab.cpp:268
SLATE_API float GetOverlapWidth() const
Definition SDockTab.cpp:935
SLATE_API TSharedRef< SWidget > GetContent()
Definition SDockTab.cpp:309
SLATE_API bool ShouldAutosize() const
Definition SDockTab.cpp:986
TWeakPtr< SDockingArea > ParentDockingAreaPtr
Definition SDockTab.h:467
SLATE_API void SetOnPersistVisualState(const FOnPersistVisualState &Handler)
Definition SDockTab.cpp:457
SLATE_API void SetOnTabDraggedOverDockArea(const FSimpleDelegate InDelegate)
Definition SDockTab.cpp:502
TSharedPtr< STextBlock > LabelWidget
Definition SDockTab.h:537
TSharedPtr< SImage > IconWidget
Definition SDockTab.h:541
SLATE_API bool HasSiblingTab(const FTabId &SiblingTabId, const bool TreatIndexNoneAsWildcard=true) const
Definition SDockTab.cpp:578
Definition SDockingArea.h:29
Definition SDockingTabStack.h:52
Definition SDockingTabWell.h:32
Definition SImage.h:29
Definition STabSidebar.h:25
Definition STextBlock.h:45
Definition SToolTip.h:22
Definition SWidget.h:165
Definition SWindow.h:243
Definition Attribute.h:17
Definition SharedPointer.h:692
Definition SharedPointer.h:153
Definition SharedPointer.h:1295
Definition STabPanelDrawer.h:17
Definition DockingUtilsPrivate.h:8
FDeprecateSlateVector2D FDeprecateVector2DResult
Definition SlateVector2.h:469
@ false
Definition radaudio_common.h:23
Definition Visibility.h:12
Definition CurveSequence.h:26
Definition SlateTypes.h:1911
Definition Geometry.h:40
Definition Color.h:48
Definition Margin.h:17
Definition Events.h:695
Definition SlateBrush.h:239
Definition SlateColor.h:42
Definition TabManager.h:73
Definition Optional.h:131