Files
UnrealEngineUWP/Engine/Source/Editor/LevelEditor/Private/SLevelEditorToolBox.h
Matt Kuhlenschmidt cd26fdd0cf Tab drawer improvements
- activating an editor mode that was already active but in an drawer, opens that drawer
- dock tabs can now register for drawer opening/closing callbacks so that they can do stuff when the drawer opens or closes. For example, now the placement browser focuses its search field when the drawer opens

[CL 14723696 by Matt Kuhlenschmidt in ue5-main branch]
2020-11-11 16:21:17 -04:00

89 lines
2.7 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Textures/SlateIcon.h"
#include "Layout/Visibility.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Widgets/SCompoundWidget.h"
#include "Editor.h"
#include "ILevelEditor.h"
#include "Misc/NotifyHook.h"
#include "StatusBarSubsystem.h"
class FExtender;
class SBorder;
class IToolkit;
class SDockTab;
class ILevelEditor;
/**
* Tools for the level editor
*/
class SLevelEditorToolBox : public SCompoundWidget, public FNotifyHook
{
public:
SLATE_BEGIN_ARGS( SLevelEditorToolBox ){}
SLATE_END_ARGS()
~SLevelEditorToolBox();
void Construct(const FArguments& InArgs, const TSharedRef<ILevelEditor>& OwningLevelEditor);
/** Called by SLevelEditor to notify the toolbox about a new toolkit being hosted */
void OnToolkitHostingStarted( const TSharedRef<IToolkit>& Toolkit);
/** Called by SLevelEditor to notify the toolbox about an existing toolkit no longer being hosted */
void OnToolkitHostingFinished(const TSharedRef<IToolkit>& Toolkit);
/** Handles updating the mode toolbar when the registered mode commands change */
void OnEditorModeCommandsChanged();
/** Sets the parent tab of this toolbox */
void SetParentTab(TSharedRef<SDockTab>& InDockTab);
private:
void OnContainingTabActivated(TSharedRef<SDockTab> DockTab, ETabActivationCause InActivationCause);
/** Gets the visibility for the SBorder showing toolbox editor mode inline content */
EVisibility GetInlineContentHolderVisibility() const;
/** Gets the visibility for the message suggesting the user select a tool */
EVisibility GetNoToolSelectedTextVisibility() const;
/** Updates the widget for showing toolbox editor mode inline content */
void UpdateInlineContent(const TSharedPtr<IToolkit>& Toolkit, TSharedPtr<SWidget> InlineContent);
/** Creates and sets the mode toolbar */
void UpdateModeLegacyToolBar();
/** Handles updating the mode toolbar when the user settings change */
void HandleUserSettingsChange( FName PropertyName );
private:
/** Parent tab where this toolbox is hosted */
TWeakPtr<SDockTab> ParentTab;
/** Level editor that we're associated with */
TWeakPtr<ILevelEditor> LevelEditor;
/** Inline content area for editor modes */
TSharedPtr<SBorder> InlineContentHolder;
/** The container holding the mode toolbar */
TSharedPtr<SBorder> ModeToolBarContainer;
/** The active tool header area **/
TSharedPtr<SBorder> ModeToolHeader;
/** The display name that the parent tab should have as its label */
FText TabName;
/** The icon that should be displayed in the parent tab */
const FSlateBrush* TabIcon;
/** Handle to status bar messages for removing them later */
FStatusBarMessageHandle StatusBarMessageHandle;
};