2019-12-26 15:33:43 -05:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
2014-03-14 14:13:41 -04:00
|
|
|
|
2016-11-23 15:48:37 -05:00
|
|
|
#include "CoreMinimal.h"
|
|
|
|
|
#include "Framework/Application/SlateApplication.h"
|
2018-01-20 11:19:29 -05:00
|
|
|
#include "Classes/EditorStyleSettings.h"
|
|
|
|
|
#include "Misc/ConfigCacheIni.h"
|
|
|
|
|
#include "Modules/ModuleManager.h"
|
2016-11-23 15:48:37 -05:00
|
|
|
|
|
|
|
|
#if WITH_EDITOR
|
|
|
|
|
#include "UObject/UnrealType.h"
|
|
|
|
|
#endif
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
/* UEditorStyleSettings interface
|
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
2014-10-14 10:29:11 -04:00
|
|
|
UEditorStyleSettings::UEditorStyleSettings( const FObjectInitializer& ObjectInitializer )
|
|
|
|
|
: Super(ObjectInitializer)
|
2014-03-14 14:13:41 -04:00
|
|
|
{
|
2019-09-10 11:35:20 -04:00
|
|
|
bEnableUserEditorLayoutManagement = true;
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
SelectionColor = FLinearColor(0.828f, 0.364f, 0.003f);
|
|
|
|
|
|
2017-04-04 20:49:52 -04:00
|
|
|
EditorWindowBackgroundColor = FLinearColor::White;
|
|
|
|
|
|
2016-02-25 15:13:33 -05:00
|
|
|
AssetEditorOpenLocation = EAssetEditorOpenLocation::Default;
|
2017-05-10 11:49:32 -04:00
|
|
|
bEnableColorizedEditorTabs = true;
|
2016-10-27 20:37:57 -04:00
|
|
|
|
|
|
|
|
bUseGrid = true;
|
2015-03-02 15:32:13 -05:00
|
|
|
|
2021-05-13 09:36:03 -04:00
|
|
|
bCycleToOutputLogDrawer = true;
|
|
|
|
|
|
2016-07-08 14:59:19 -04:00
|
|
|
RegularColor = FLinearColor(0.035f, 0.035f, 0.035f);
|
|
|
|
|
RuleColor = FLinearColor(0.008f, 0.008f, 0.008f);
|
|
|
|
|
CenterColor = FLinearColor::Black;
|
|
|
|
|
|
2016-10-27 20:37:57 -04:00
|
|
|
GridSnapSize = 16.f;
|
2016-07-08 14:59:19 -04:00
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
bShowFriendlyNames = true;
|
2020-09-24 00:43:27 -04:00
|
|
|
bShowNativeComponentNames = true;
|
2014-11-10 15:13:41 -05:00
|
|
|
LogTimestampMode = ELogTimes::None;
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
2017-11-06 18:22:01 -05:00
|
|
|
void UEditorStyleSettings::Init()
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
// Set from CVar
|
|
|
|
|
IConsoleVariable* CVar = IConsoleManager::Get().FindConsoleVariable(TEXT("EnableHighDPIAwareness"));
|
|
|
|
|
bEnableHighDPIAwareness = CVar->GetInt() != 0;
|
|
|
|
|
}
|
|
|
|
|
|
2015-02-09 11:52:11 -05:00
|
|
|
FLinearColor UEditorStyleSettings::GetSubduedSelectionColor() const
|
|
|
|
|
{
|
|
|
|
|
FLinearColor SubduedSelectionColor = SelectionColor.LinearRGBToHSV();
|
|
|
|
|
SubduedSelectionColor.G *= 0.55f; // take the saturation
|
|
|
|
|
SubduedSelectionColor.B *= 0.8f; // and brightness down
|
|
|
|
|
|
|
|
|
|
return SubduedSelectionColor.HSVToLinearRGB();
|
|
|
|
|
}
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
#if WITH_EDITOR
|
|
|
|
|
|
|
|
|
|
void UEditorStyleSettings::PostEditChangeProperty(struct FPropertyChangedEvent& PropertyChangedEvent)
|
|
|
|
|
{
|
|
|
|
|
Super::PostEditChangeProperty(PropertyChangedEvent);
|
|
|
|
|
|
2015-07-07 03:43:55 -04:00
|
|
|
const FName PropertyName = (PropertyChangedEvent.Property != nullptr) ? PropertyChangedEvent.Property->GetFName() : NAME_None;
|
2014-03-14 14:13:41 -04:00
|
|
|
|
|
|
|
|
|
2017-11-06 18:22:01 -05:00
|
|
|
// This property is intentionally not per project so it must be manually written to the correct config file
|
|
|
|
|
if (PropertyName == GET_MEMBER_NAME_CHECKED(UEditorStyleSettings, bEnableHighDPIAwareness))
|
|
|
|
|
{
|
|
|
|
|
GConfig->SetBool(TEXT("HDPI"), TEXT("EnableHighDPIAwareness"), bEnableHighDPIAwareness, GEditorSettingsIni);
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-14 14:13:41 -04:00
|
|
|
// if (!FUnrealEdMisc::Get().IsDeletePreferences())
|
|
|
|
|
{
|
|
|
|
|
SaveConfig();
|
|
|
|
|
}
|
|
|
|
|
|
2015-07-07 03:43:55 -04:00
|
|
|
SettingChangedEvent.Broadcast(PropertyName);
|
2014-03-14 14:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|