Files
UnrealEngineUWP/Engine/Source/Editor/EditorStyle/Private/EditorStyleSettingsCustomization.h
Matt Kuhlenschmidt f594e50cd2 Added basic theme editing support and a Dark theme as an example.
Themes are basic json files which can change the named colors that the editor uses for its UI.  They work similarly to config files in that the same theme in a user dir overrides the project dir and the base dir.
Themes only work in the editor or standalone programs. Not supported in UMG or shipping games

[CL 14179270 by Matt Kuhlenschmidt in ue5-main branch]
2020-08-25 10:31:42 -04:00

54 lines
1.9 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#pragma once
#include "IDetailCustomization.h"
#include "IPropertyTypeCustomization.h"
#include "Styling/StyleColors.h"
class IDetailLayoutBuilder;
class STextComboBox;
class IDetailPropertyRow;
#if ALLOW_THEMES
DECLARE_DELEGATE_OneParam(FOnThemeEditorClosed, bool)
class FStyleColorListCustomization : public IPropertyTypeCustomization
{
public:
static TSharedRef<IPropertyTypeCustomization> MakeInstance();
virtual void CustomizeHeader(TSharedRef<IPropertyHandle> PropertyHandle, FDetailWidgetRow& HeaderRow, IPropertyTypeCustomizationUtils& CustomizationUtils) override;
virtual void CustomizeChildren(TSharedRef<IPropertyHandle> PropertyHandle, IDetailChildrenBuilder& ChildBuilder, IPropertyTypeCustomizationUtils& CustomizationUtils) override;
private:
void OnResetColorToDefault(TSharedPtr<IPropertyHandle> Handle, EStyleColor Color);
bool IsResetToDefaultVisible(TSharedPtr<IPropertyHandle> Handle, EStyleColor Color);
};
class FEditorStyleSettingsCustomization : public IDetailCustomization
{
public:
/** Makes a new instance of this detail layout class for a specific detail view requesting it */
static TSharedRef<IDetailCustomization> MakeInstance();
/** IDetailCustomization interface */
virtual void CustomizeDetails(IDetailLayoutBuilder& DetailLayout) override;
void RefreshComboBox();
private:
void GenerateThemeOptions(TSharedPtr<FString>& OutSelectedTheme);
void MakeThemePickerRow(IDetailPropertyRow& PropertyRow);
FReply OnDuplicateAndEditThemeClicked();
FReply OnEditThemeClicked();
FString GetTextLabelForThemeEntry(TSharedPtr<FString> Entry);
void OnThemePicked(TSharedPtr<FString> NewSelection, ESelectInfo::Type SelectInfo);
void OpenThemeEditorWindow(FOnThemeEditorClosed OnThemeEditorClosed);
bool IsThemeEditingEnabled() const;
private:
TArray<TSharedPtr<FString>> ThemeOptions;
TSharedPtr<STextComboBox> ComboBox;
};
#endif