Files
UnrealEngineUWP/Engine/Source/Developer/GammaUI/Private/GammaUIPanel.cpp
Ryan Vance 7c51ff94af Merging //UE4/Dev-Main to Dev-VR (//UE4/Dev-VR)
CL 1 of 8
#rb integration

[CL 4748712 by Ryan Vance in Dev-VR branch]
2019-01-17 18:54:05 -05:00

62 lines
1.3 KiB
C++

// Copyright 1998-2019 Epic Games, Inc. All Rights Reserved.
#include "GammaUIPanel.h"
#include "EngineGlobals.h"
#include "Engine/Engine.h"
#include "Widgets/SBoxPanel.h"
#include "Widgets/Images/SImage.h"
#include "Widgets/Text/STextBlock.h"
#include "Widgets/Input/SSpinBox.h"
#include "EditorStyleSet.h"
void SGammaUIPanel::Construct(const SGammaUIPanel::FArguments& InArgs)
{
ChildSlot
.Padding( FMargin(8) )
[
SNew( SVerticalBox )
+ SVerticalBox::Slot()
.AutoHeight()
.Padding( 0.0f, 4.0f, 0.0f, 4.0f )
[
SNew( STextBlock )
.Text( NSLOCTEXT( "GammaUI", "GammaUILabel", "Gamma" ) )
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding( 0.0f, 4.0f, 0.0f, 4.0f )
[
SNew( SSpinBox<float> )
.Delta(0.01f)
.MinValue(1.0f)
.MaxValue(3.0f)
.Value( this, &SGammaUIPanel::OnGetGamma )
.OnValueChanged( this, &SGammaUIPanel::OnGammaChanged )
]
+ SVerticalBox::Slot()
.AutoHeight()
.Padding( 0.0f, 4.0f, 0.0f, 4.0f )
.HAlign( HAlign_Center )
[
SNew(SImage)
.Image(FEditorStyle::GetBrush(TEXT("GammaReference")))
]
];
}
float SGammaUIPanel::OnGetGamma() const
{
return GEngine ? GEngine->DisplayGamma : 2.2f;
}
void SGammaUIPanel::OnGammaChanged(float NewValue)
{
if( GEngine )
{
GEngine->DisplayGamma = NewValue;
}
}