Files
UnrealEngineUWP/Engine/Source/Developer/ToolWidgets/Public/SPositiveActionButton.h
aurel cordonnier 34f55d3a4a Merge from Release-Engine-Test @ 17946149 to UE5/Main
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035

[CL 17949667 by aurel cordonnier in ue5-main branch]
2021-10-27 15:14:40 -04:00

50 lines
1.4 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "Framework/SlateDelegates.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Widgets/SCompoundWidget.h"
#include "Widgets/Input/SComboButton.h"
/** A Button that is used to call out/highlight a positive option (Add, Save etc). It can also be used to open a menu.
*/
class TOOLWIDGETS_API SPositiveActionButton : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(SPositiveActionButton) :
_Icon(FAppStyle::Get().GetBrush("Icons.Plus"))
{}
/** The text to display in the button. */
SLATE_ATTRIBUTE(FText, Text)
SLATE_ATTRIBUTE(const FSlateBrush*, Icon)
/** The clicked handler. Note that if this is set, the button will behave as though it were just a button.
* This means that OnGetMenuContent, OnComboBoxOpened and OnMenuOpenChanged will all be ignored, since there is no menu.
*/
SLATE_EVENT(FOnClicked, OnClicked)
/** The static menu content widget. */
SLATE_NAMED_SLOT(FArguments, MenuContent)
SLATE_EVENT(FOnGetContent, OnGetMenuContent)
SLATE_EVENT(FOnComboBoxOpened, OnComboBoxOpened)
SLATE_EVENT(FOnIsOpenChanged, OnMenuOpenChanged)
SLATE_END_ARGS()
SPositiveActionButton() {}
void Construct(const FArguments& InArgs);
void SetMenuContentWidgetToFocus(TWeakPtr<SWidget> Widget);
void SetIsMenuOpen(bool bIsOpen, bool bIsFocused);
private:
TSharedPtr<SComboButton> ComboButton;
TSharedPtr<class SButton> Button;
};