Files
UnrealEngineUWP/Engine/Source/Developer/ProjectLauncher/Private/Widgets/Shared/SProjectLauncherProfileNameDescEditor.cpp
ryan durand 471d972e62 Updating copyright for Engine Developer.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869240 via CL 10869516 via CL 10869902
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870584 by ryan durand in Main branch]
2019-12-26 15:32:37 -05:00

81 lines
2.1 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "SProjectLauncherProfileNameDescEditor.h"
#include "Styling/CoreStyle.h"
#include "Widgets/SBoxPanel.h"
#include "Widgets/Images/SImage.h"
#include "Widgets/Layout/SBox.h"
#include "Widgets/Text/SInlineEditableTextBlock.h"
#define LOCTEXT_NAMESPACE "SProjectLauncherProfileNameDescEditor"
void SProjectLauncherProfileNameDescEditor::Construct(const FArguments& InArgs, const TSharedRef<FProjectLauncherModel>& InModel, bool InShowAddDescriptionText)
{
EnterTextDescription = FText(LOCTEXT("LaunchProfileEnterDescription", "Enter a description here."));
Model = InModel;
LaunchProfileAttr = InArgs._LaunchProfile;
bShowAddDescriptionText = InShowAddDescriptionText;
ChildSlot
[
SNew(SHorizontalBox)
+ SHorizontalBox::Slot()
.AutoWidth()
.VAlign(VAlign_Center)
[
SNew(SBox)
.WidthOverride(40)
.HeightOverride(40)
[
SNew(SImage)
.Image(this, &SProjectLauncherProfileNameDescEditor::HandleProfileImage)
]
]
+ SHorizontalBox::Slot()
.FillWidth(1)
.VAlign(VAlign_Center)
[
SNew(SVerticalBox)
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(2, 4, 2, 4)
[
SAssignNew(NameEditableTextBlock, SInlineEditableTextBlock)
.Text(this, &SProjectLauncherProfileNameDescEditor::OnGetNameText)
.OnTextCommitted(this, &SProjectLauncherProfileNameDescEditor::OnNameTextCommitted)
.Cursor(EMouseCursor::TextEditBeam)
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding(2, 4, 2, 4)
[
SNew(SInlineEditableTextBlock)
.Text(this, &SProjectLauncherProfileNameDescEditor::OnGetDescriptionText)
.Style(FCoreStyle::Get(), "InlineEditableTextBlockSmallStyle")
.OnTextCommitted(this, &SProjectLauncherProfileNameDescEditor::OnDescriptionTextCommitted)
.Cursor(EMouseCursor::TextEditBeam)
]
]
];
}
void SProjectLauncherProfileNameDescEditor::TriggerNameEdit()
{
if (NameEditableTextBlock.IsValid())
{
NameEditableTextBlock->EnterEditingMode();
}
}
#undef LOCTEXT_NAMESPACE