You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#preflight 6272a74d2f6d177be3c6fdda #rb Matt.Kuhlenschmidt #ROBOMERGE-OWNER: Lauren.Barnes #ROBOMERGE-AUTHOR: lauren.barnes #ROBOMERGE-SOURCE: CL 20057269 via CL 20070159 via CL 20072035 via CL 20072203 #ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v943-19904690) #ROBOMERGE-CONFLICT from-shelf [CL 20105363 by Lauren Barnes in ue5-main branch]
84 lines
2.3 KiB
C++
84 lines
2.3 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "SPerPlatformPropertiesWidget.h"
|
|
#include "Layout/Margin.h"
|
|
#include "Fonts/SlateFontInfo.h"
|
|
#include "Styling/CoreStyle.h"
|
|
#include "Framework/MultiBox/MultiBoxBuilder.h"
|
|
#include "Widgets/Input/SButton.h"
|
|
#include "Widgets/Input/SComboButton.h"
|
|
#include "PlatformInfo.h"
|
|
#include "Widgets/Layout/SWrapBox.h"
|
|
#include "Styling/AppStyle.h"
|
|
#include "Widgets/Layout/SBox.h"
|
|
#include "DetailLayoutBuilder.h"
|
|
#include "Widgets/Images/SImage.h"
|
|
#include "PerQualityLevelProperties.h"
|
|
|
|
void SPerPlatformPropertiesRow::Construct(const FArguments& InArgs, FName PlatformName)
|
|
{
|
|
this->OnGenerateWidget = InArgs._OnGenerateWidget;
|
|
this->OnRemovePlatform = InArgs._OnRemovePlatform;
|
|
|
|
ChildSlot
|
|
[
|
|
MakePerPlatformWidget(PlatformName)
|
|
];
|
|
|
|
}
|
|
|
|
|
|
FReply SPerPlatformPropertiesRow::RemovePlatform(FName PlatformName)
|
|
{
|
|
if (OnRemovePlatform.IsBound())
|
|
{
|
|
OnRemovePlatform.Execute(PlatformName);
|
|
}
|
|
|
|
return FReply::Handled();
|
|
}
|
|
|
|
TSharedRef<SWidget> SPerPlatformPropertiesRow::MakePerPlatformWidget(FName InName)
|
|
{
|
|
TSharedPtr<SHorizontalBox> HorizontalBox;
|
|
|
|
TSharedRef<SWidget> Widget =
|
|
SNew(SBox)
|
|
.Padding(FMargin(0.0f, 2.0f, 4.0f, 2.0f))
|
|
.MinDesiredWidth(50.0f)
|
|
[
|
|
SAssignNew(HorizontalBox, SHorizontalBox)
|
|
.ToolTipText((InName != NAME_None)
|
|
? FText::Format(NSLOCTEXT("SPerPlatformPropertiesWidget", "PerPlatformDesc", "Override for {0}"), FText::AsCultureInvariant(InName.ToString()))
|
|
: NSLOCTEXT("SPerPlatformPropertiesWidget", "DefaultDesc", "Default value for properties without an override"))
|
|
+SHorizontalBox::Slot()
|
|
.Padding(0.0f, 0.0f, 2.0f, 0.0f)
|
|
.VAlign(VAlign_Center)
|
|
[
|
|
OnGenerateWidget.Execute(InName)
|
|
]
|
|
];
|
|
|
|
if(InName != NAME_None)
|
|
{
|
|
HorizontalBox->AddSlot()
|
|
.AutoWidth()
|
|
.Padding(2.0f, 0.0f, 0.0f, 0.0f)
|
|
.VAlign(VAlign_Center)
|
|
[
|
|
SNew(SButton)
|
|
.ButtonStyle(FAppStyle::Get(), "SimpleButton")
|
|
.OnClicked(this, &SPerPlatformPropertiesRow::RemovePlatform, InName)
|
|
.ToolTipText(FText::Format(NSLOCTEXT("SPerPlatformPropertiesWidget", "RemoveOverrideFor", "Remove Override for {0}"), FText::AsCultureInvariant(InName.ToString())))
|
|
.Content()
|
|
[
|
|
SNew(SImage)
|
|
.Image(FAppStyle::GetBrush("Icons.Delete"))
|
|
.ColorAndOpacity(FSlateColor::UseForeground())
|
|
]
|
|
];
|
|
}
|
|
|
|
|
|
return Widget;
|
|
} |