2014-12-07 19:09:38 -05:00
|
|
|
// Copyright 1998-2015 Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/*=============================================================================
|
|
|
|
|
SScreenViewRow.cpp: implements the SScreenViewRow class.
|
|
|
|
|
=============================================================================*/
|
|
|
|
|
|
|
|
|
|
#include "ScreenShotComparisonPrivatePCH.h"
|
|
|
|
|
|
|
|
|
|
#define LOCTEXT_NAMESPACE "SScreenShotBrowser"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SScreenViewRow::Construct( const FArguments& InArgs, const TSharedRef<STableViewBase>& InOwnerTableView )
|
|
|
|
|
{
|
|
|
|
|
STableRow<TSharedPtr<IScreenShotData> >::ConstructInternal(
|
|
|
|
|
STableRow::FArguments()
|
|
|
|
|
.ShowSelection(true),
|
|
|
|
|
InOwnerTableView
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
// The screen shot item to view
|
|
|
|
|
TSharedPtr<IScreenShotData> ScreenShotData = InArgs._ScreenShotData;
|
|
|
|
|
|
|
|
|
|
// The display string for the view
|
2014-11-26 12:46:05 -05:00
|
|
|
const FText InfoText = FText::Format( LOCTEXT("ScreenShotNameFmt", "Screen shot: {0}"), FText::FromString(ScreenShotData->GetName()) );
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
ChildSlot
|
|
|
|
|
[
|
|
|
|
|
SNew(SBorder)
|
|
|
|
|
[
|
|
|
|
|
SNew( SVerticalBox )
|
|
|
|
|
+SVerticalBox::Slot()
|
|
|
|
|
.AutoHeight()
|
|
|
|
|
[
|
|
|
|
|
SNew( SBorder )
|
|
|
|
|
.BorderImage(FEditorStyle::GetBrush("ToolPanel.GroupBorder"))
|
|
|
|
|
.Content()
|
|
|
|
|
[
|
|
|
|
|
SNew( STextBlock ) .Text( InfoText )
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
+SVerticalBox::Slot()
|
|
|
|
|
.AutoHeight()
|
|
|
|
|
[
|
|
|
|
|
// The screen view being tested
|
|
|
|
|
SAssignNew( ScreenShotDataView, SListView< TSharedPtr<IScreenShotData> > )
|
|
|
|
|
// Tell the screen view where to get its source data
|
|
|
|
|
.ListItemsSource( &ScreenShotData->GetFilteredChildren() )
|
|
|
|
|
// When the list view needs to generate a widget for each screen view, use this method
|
|
|
|
|
.OnGenerateRow( this, &SScreenViewRow::OnGenerateWidgetForScreenView )
|
|
|
|
|
.SelectionMode(ESelectionMode::None)
|
|
|
|
|
.HeaderRow
|
|
|
|
|
(
|
|
|
|
|
SNew(SHeaderRow)
|
|
|
|
|
+ SHeaderRow::Column( "Platform" )
|
|
|
|
|
.HAlignHeader(HAlign_Center)
|
|
|
|
|
.VAlignHeader(VAlign_Center)
|
|
|
|
|
.HAlignCell(HAlign_Center)
|
|
|
|
|
.VAlignCell(VAlign_Center)
|
|
|
|
|
.FixedWidth( 200.0f )
|
2014-11-26 12:46:05 -05:00
|
|
|
.DefaultLabel(LOCTEXT("PlatformName", "Platform"))
|
2014-03-14 14:13:41 -04:00
|
|
|
+ SHeaderRow::Column( "Current View" )
|
|
|
|
|
.HAlignHeader(HAlign_Center)
|
|
|
|
|
.VAlignHeader(VAlign_Center)
|
|
|
|
|
.HAlignCell(HAlign_Center)
|
|
|
|
|
.VAlignCell(VAlign_Center)
|
|
|
|
|
.FixedWidth( 300.0f )
|
2014-11-26 12:46:05 -05:00
|
|
|
.DefaultLabel(LOCTEXT("CurrentViewName", "Current View"))
|
2014-03-14 14:13:41 -04:00
|
|
|
+ SHeaderRow::Column( "History View" )
|
2014-11-26 12:46:05 -05:00
|
|
|
.DefaultLabel(LOCTEXT("HistoryViewName", "History"))
|
2014-03-14 14:13:41 -04:00
|
|
|
)
|
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TSharedRef<ITableRow> SScreenViewRow::OnGenerateWidgetForScreenView( TSharedPtr<IScreenShotData> InScreenShotDataItem, const TSharedRef<STableViewBase>& OwnerTable )
|
|
|
|
|
{
|
|
|
|
|
// Create a new row per platform
|
|
|
|
|
return
|
|
|
|
|
SNew( SScreenPlatformRow, OwnerTable )
|
|
|
|
|
. ScreenShotDataItem( InScreenShotDataItem );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#undef LOCTEXT_NAMESPACE
|