Files
UnrealEngineUWP/Engine/Source/Editor/TimeManagementEditor/Public/STimecodeProvider.h
ryan durand 627baf970a Updating copyright for Engine Editor.
#rnx
#rb none


#ROBOMERGE-SOURCE: CL 10869241 via CL 10869527 via CL 10869904
#ROBOMERGE-BOT: (v613-10869866)

[CL 10870586 by ryan durand in Main branch]
2019-12-26 15:33:43 -05:00

81 lines
2.5 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "CoreMinimal.h"
#include "Widgets/DeclarativeSyntaxSupport.h"
#include "Widgets/SCompoundWidget.h"
#include "Engine/TimecodeProvider.h"
#include "Fonts/SlateFontInfo.h"
#include "Layout/Visibility.h"
#include "Misc/Attribute.h"
#include "Misc/Timecode.h"
#include "Styling/CoreStyle.h"
#include "Styling/SlateColor.h"
#include "UObject/WeakObjectPtrTemplates.h"
struct FSlateBrush;
class TIMEMANAGEMENTEDITOR_API STimecodeProvider : public SCompoundWidget
{
public:
SLATE_BEGIN_ARGS(STimecodeProvider)
: _TimecodeProviderColor(FLinearColor::Gray)
, _DisplayFrameRate(true)
, _DisplaySynchronizationState(true)
, _TimecodeColor(FLinearColor::White)
, _DisplayLabel(true)
, _LabelColor(FLinearColor::Gray)
{
FSlateFontInfo NormalFontInfo = FCoreStyle::Get().GetFontStyle(TEXT("NormalText"));
int32 OriginalSize = NormalFontInfo.Size;
_LabelFont = NormalFontInfo;
NormalFontInfo.Size = OriginalSize - 4;
_TimecodeProviderFont = NormalFontInfo;
NormalFontInfo.Size = OriginalSize + 16;
_TimecodeFont = NormalFontInfo;
}
/** The font for this TimecodeProvider text */
SLATE_ATTRIBUTE(FSlateFontInfo, TimecodeProviderFont)
/** The color for this TimecodeProvider text */
SLATE_ATTRIBUTE(FSlateColor, TimecodeProviderColor)
/** Should display the TimecodeProvider's frame rate */
SLATE_ARGUMENT(bool, DisplayFrameRate)
/** Should display the TimecodeProvider's synchronization state */
SLATE_ARGUMENT(bool, DisplaySynchronizationState)
/** Override the Timecode Provider to display */
SLATE_ATTRIBUTE(TWeakObjectPtr<UTimecodeProvider>, OverrideTimecodeProvider)
/** The font for the timecode text */
SLATE_ATTRIBUTE(FSlateFontInfo, TimecodeFont)
/** The color for the timecode text */
SLATE_ATTRIBUTE(FSlateColor, TimecodeColor)
/** Should display the label (hours, mins, secs, frames) */
SLATE_ATTRIBUTE(bool, DisplayLabel)
/** The font for this label text */
SLATE_ATTRIBUTE(FSlateFontInfo, LabelFont)
/** The color for this label text */
SLATE_ATTRIBUTE(FSlateColor, LabelColor)
SLATE_END_ARGS()
/**
* Construct this widget
*
* @param InArgs The declaration data for this widget
*/
void Construct(const FArguments& InArgs);
private:
const UTimecodeProvider* GetTimecodeProvider() const;
FSlateColor HandleIconColorAndOpacity() const;
FText HandleStateText() const;
private:
TAttribute<TWeakObjectPtr<UTimecodeProvider>> OverrideTimecodeProvider;
};