You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Creating a small text variant of SSimpleComboButton
#jira none #rb Aditya.RaviChandran #fyi Thomas.Sarkanen #preflight 64419fbb434155a8f8619737 [CL 25144433 by Lauren Barnes in ue5-main branch]
This commit is contained in:
@@ -4,12 +4,13 @@
|
||||
#include "Widgets/SBoxPanel.h"
|
||||
#include "Widgets/Images/SImage.h"
|
||||
#include "Widgets/Text/STextBlock.h"
|
||||
#include "Styling/SlateTypes.h"
|
||||
|
||||
void SSimpleComboButton::Construct(const FArguments& InArgs)
|
||||
{
|
||||
|
||||
TAttribute<FText> Text = InArgs._Text;
|
||||
|
||||
FTextBlockStyle TextStyle = InArgs._UsesSmallText ? FAppStyle::GetWidgetStyle<FTextBlockStyle>("SmallText") : FAppStyle::GetWidgetStyle<FTextBlockStyle>("SmallButtonText");
|
||||
|
||||
TSharedRef<SHorizontalBox> ButtonContent = SNew(SHorizontalBox)
|
||||
+ SHorizontalBox::Slot()
|
||||
@@ -24,12 +25,13 @@ void SSimpleComboButton::Construct(const FArguments& InArgs)
|
||||
+ SHorizontalBox::Slot()
|
||||
.Padding(FMargin(3, 0, 0, 0))
|
||||
.VAlign(VAlign_Center)
|
||||
.AutoWidth()
|
||||
.FillWidth(1.0f)
|
||||
[
|
||||
SNew(STextBlock)
|
||||
.TextStyle(FAppStyle::Get(), "SmallButtonText")
|
||||
.TextStyle(&TextStyle)
|
||||
.Text(InArgs._Text)
|
||||
.Visibility_Lambda([Text]() { return Text.Get(FText::GetEmpty()).IsEmpty() ? EVisibility::Collapsed : EVisibility::Visible; })
|
||||
.Clipping(EWidgetClipping::OnDemand)
|
||||
];
|
||||
|
||||
SComboButton::Construct(SComboButton::FArguments()
|
||||
|
||||
@@ -12,6 +12,7 @@ public:
|
||||
|
||||
SLATE_BEGIN_ARGS(SSimpleComboButton)
|
||||
: _HasDownArrow(false)
|
||||
, _UsesSmallText(false)
|
||||
{}
|
||||
/** The text to display in the button. */
|
||||
SLATE_ATTRIBUTE(FText, Text)
|
||||
@@ -25,6 +26,7 @@ public:
|
||||
SLATE_EVENT(FOnComboBoxOpened, OnComboBoxOpened)
|
||||
SLATE_EVENT(FOnIsOpenChanged, OnMenuOpenChanged)
|
||||
SLATE_ARGUMENT(bool, HasDownArrow)
|
||||
SLATE_ARGUMENT(bool, UsesSmallText)
|
||||
|
||||
SLATE_END_ARGS()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user