You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
This represents UE4/Main @17911760, Release-5.0 @17915875 and Dev-PerfTest @17914035 [CL 17949667 by aurel cordonnier in ue5-main branch]
50 lines
1.4 KiB
C++
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;
|
|
}; |