bAdvancedSectionExpanded

bAdvancedSectionExpanded

#Overview

name: bAdvancedSectionExpanded

The value of this variable can be defined or overridden in .ini config files. 1 .ini config file referencing this setting variable.

It is referenced in 5 C++ source files.

#Summary

#Usage in the C++ source code

The purpose of bAdvancedSectionExpanded is to control the visibility of the advanced section in the color picker interface within Unreal Engine’s UI system.

This setting variable is primarily used in the AppFramework module, specifically within the SColorPicker class, which is part of Unreal Engine’s UI system for color selection.

The value of this variable is initially set by reading from the GEditorPerProjectIni configuration file. If the file exists, the value is read from the “ColorPickerUI” section with the key “bAdvancedSectionExpanded”. If the file doesn’t exist or the key is not found, it defaults to false.

This variable interacts with other color picker settings such as bWheelMode and bSRGBEnabled, which are also read from the same configuration file.

Developers should be aware that:

  1. This variable affects the initial state of the advanced section in the color picker.
  2. Its value is persisted between sessions in the project’s configuration file.
  3. It can be overridden by the _ExpandAdvancedSection argument when constructing the SColorPicker.

Best practices when using this variable include:

  1. Consider the user experience when deciding whether to expand the advanced section by default.
  2. Be consistent in its usage across your project to maintain a uniform UI experience.
  3. If you’re creating a custom color picker, respect this setting to align with user expectations.
  4. Remember to update the configuration file if you programmatically change this setting to persist the user’s preference.

#Setting Variables

#References In INI files

Location: <Workspace>/Engine/Config/BaseEditorPerProjectUserSettings.ini:464, section: [ColorPickerUI]

#References in C++ code

#Callsites

This variable is referenced in the following C++ source code:

#Loc: <Workspace>/Engine/Source/Runtime/AppFramework/Private/Widgets/Colors/SColorPicker.cpp:98

Scope (from outer to inner):

file
function     void SColorPicker::Construct

Source code excerpt:

	BeginAnimation(FLinearColor(ForceInit), CurrentColorHSV);

	bool bAdvancedSectionExpanded = false;

	if (FPaths::FileExists(GEditorPerProjectIni))
	{
		bool WheelMode = true;

		GConfig->GetBool(TEXT("ColorPickerUI"), TEXT("bWheelMode"), WheelMode, GEditorPerProjectIni);
		GConfig->GetBool(TEXT("ColorPickerUI"), TEXT("bAdvancedSectionExpanded"), bAdvancedSectionExpanded, GEditorPerProjectIni);
		GConfig->GetBool(TEXT("ColorPickerUI"), TEXT("bSRGBEnabled"), SColorThemesViewer::bSRGBEnabled, GEditorPerProjectIni);

		CurrentMode = WheelMode ? EColorPickerModes::Wheel : EColorPickerModes::Spectrum;
	}

	bAdvancedSectionExpanded |= InArgs._ExpandAdvancedSection;

	if (bColorPickerIsInlineVersion)
	{
		GenerateInlineColorPickerContent();
	}
	else
	{
		GenerateDefaultColorPickerContent(bAdvancedSectionExpanded);
	}
}


/* SColorPicker implementation
 *****************************************************************************/

#Loc: <Workspace>/Engine/Source/Runtime/AppFramework/Private/Widgets/Colors/SColorPicker.cpp:129

Scope (from outer to inner):

file
function     BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION void SColorPicker::GenerateDefaultColorPickerContent

Source code excerpt:


BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION
void SColorPicker::GenerateDefaultColorPickerContent( bool bAdvancedSectionExpanded )
{	
	// The height of the gradient bars beneath the sliders
	const FSlateFontInfo SmallLayoutFont = FAppStyle::Get().GetFontStyle("ColorPicker.Font");

	TSharedPtr<SColorThemesViewer> ThemesViewer = ColorThemesViewer.Pin();

#Loc: <Workspace>/Engine/Source/Runtime/AppFramework/Private/Widgets/Colors/SColorPicker.cpp:359

Scope (from outer to inner):

file
function     BEGIN_SLATE_FUNCTION_BUILD_OPTIMIZATION void SColorPicker::GenerateDefaultColorPickerContent

Source code excerpt:

					.AreaTitle(LOCTEXT("AdvancedAreaTitle", "Advanced"))
					.BorderBackgroundColor(FLinearColor::Transparent)
					.InitiallyCollapsed(!bAdvancedSectionExpanded)
					.OnAreaExpansionChanged(this, &SColorPicker::HandleAdvancedAreaExpansionChanged)
					.Padding(FMargin(0.0f, 1.0f, 0.0f, 8.0f))
					.BodyContent()
					[
						SNew(SHorizontalBox)

#Loc: <Workspace>/Engine/Source/Runtime/AppFramework/Private/Widgets/Colors/SColorPicker.cpp:1090

Scope (from outer to inner):

file
function     void SColorPicker::HandleAdvancedAreaExpansionChanged

Source code excerpt:

	if (FPaths::FileExists(GEditorPerProjectIni))
	{
		GConfig->SetBool(TEXT("ColorPickerUI"), TEXT("bAdvancedSectionExpanded"), Expanded, GEditorPerProjectIni);
	}
}


EVisibility SColorPicker::HandleAlphaColorBlockVisibility() const
{

#Loc: <Workspace>/Engine/Source/Runtime/AppFramework/Public/Widgets/Colors/SColorPicker.h:207

Scope: file

Source code excerpt:

	APPFRAMEWORK_API bool ApplyNewTargetColor(bool bForceUpdate = false);

	APPFRAMEWORK_API void GenerateDefaultColorPickerContent(bool bAdvancedSectionExpanded);
	APPFRAMEWORK_API void GenerateInlineColorPickerContent();

	FLinearColor GetCurrentColor() const
	{
		return CurrentColorHSV;
	}