2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-10-14 22:50:06 -04:00
|
|
|
|
|
|
|
|
#include "ProjectLauncherPrivatePCH.h"
|
|
|
|
|
#include "SProjectLauncherTaskListRow.h"
|
|
|
|
|
#include "SThrobber.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
|
|
|
|
|
TSharedRef<SWidget> SProjectLauncherTaskListRow::GenerateWidgetForColumn(const FName& ColumnName)
|
|
|
|
|
{
|
|
|
|
|
if (ColumnName == "Duration")
|
|
|
|
|
{
|
|
|
|
|
return SNew(SBox)
|
|
|
|
|
.Padding(FMargin(4.0, 0.0))
|
2015-01-07 09:52:40 -05:00
|
|
|
.VAlign(VAlign_Center)
|
2014-10-14 22:50:06 -04:00
|
|
|
[
|
|
|
|
|
SNew(STextBlock)
|
|
|
|
|
.Text(this, &SProjectLauncherTaskListRow::HandleDurationText)
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
else if (ColumnName == "Icon")
|
|
|
|
|
{
|
|
|
|
|
return SNew(SOverlay)
|
|
|
|
|
|
|
|
|
|
+ SOverlay::Slot()
|
|
|
|
|
.HAlign(HAlign_Center)
|
2015-01-07 09:52:40 -05:00
|
|
|
.VAlign(VAlign_Center)
|
2014-10-14 22:50:06 -04:00
|
|
|
[
|
|
|
|
|
SNew(SThrobber)
|
|
|
|
|
.Animate(SThrobber::VerticalAndOpacity)
|
|
|
|
|
.NumPieces(1)
|
|
|
|
|
.Visibility(this, &SProjectLauncherTaskListRow::HandleThrobberVisibility)
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
+ SOverlay::Slot()
|
|
|
|
|
.HAlign(HAlign_Center)
|
2015-01-07 09:52:40 -05:00
|
|
|
.VAlign(VAlign_Center)
|
2014-10-14 22:50:06 -04:00
|
|
|
[
|
|
|
|
|
SNew(SImage)
|
|
|
|
|
.ColorAndOpacity(this, &SProjectLauncherTaskListRow::HandleIconColorAndOpacity)
|
|
|
|
|
.Image(this, &SProjectLauncherTaskListRow::HandleIconImage)
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
else if (ColumnName == "Status")
|
|
|
|
|
{
|
|
|
|
|
return SNew(SBox)
|
|
|
|
|
.Padding(FMargin(4.0, 0.0))
|
2015-01-07 09:52:40 -05:00
|
|
|
.VAlign(VAlign_Center)
|
2014-10-14 22:50:06 -04:00
|
|
|
[
|
|
|
|
|
SNew(STextBlock)
|
|
|
|
|
.Text(this, &SProjectLauncherTaskListRow::HandleStatusText)
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
else if (ColumnName == "Task")
|
|
|
|
|
{
|
|
|
|
|
ILauncherTaskPtr TaskPtr = Task.Pin();
|
|
|
|
|
|
|
|
|
|
if (TaskPtr.IsValid())
|
|
|
|
|
{
|
|
|
|
|
return SNew(SBox)
|
|
|
|
|
.Padding(FMargin(4.0, 0.0))
|
2015-01-07 09:52:40 -05:00
|
|
|
.VAlign(VAlign_Center)
|
2014-10-14 22:50:06 -04:00
|
|
|
[
|
|
|
|
|
SNew(STextBlock)
|
2015-01-07 09:52:40 -05:00
|
|
|
.Text(FText::FromString(TaskPtr->GetDesc()))
|
2014-10-14 22:50:06 -04:00
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return SNullWidget::NullWidget;
|
|
|
|
|
}
|
|
|
|
|
END_SLATE_FUNCTION_BUILD_OPTIMIZATION
|