DetailsPanel.Style.EnableCardLayout
DetailsPanel.Style.EnableCardLayout
#Overview
name: DetailsPanel.Style.EnableCardLayout
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
Specifies whether the card layout is in effect for the Details View.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of DetailsPanel.Style.EnableCardLayout is to control the layout style of the Details View in the Unreal Engine editor. Specifically, it determines whether the card layout is enabled for the Details View.
This setting variable is primarily used in the Property Editor module of Unreal Engine, which is responsible for displaying and editing properties of objects in the editor interface.
The value of this variable is set through a console variable (CVar) system. It’s defined as a static TAutoConsoleVariable with a default value of false, meaning the card layout is disabled by default.
The associated variable CVarDetailsPanelEnableCardLayout directly interacts with DetailsPanel.Style.EnableCardLayout. They are essentially the same thing, with CVarDetailsPanelEnableCardLayout being the C++ representation of the console variable.
Developers should be aware that changing this variable will affect the visual presentation of the Details View in the editor. The card layout is an alternative style that may provide a different user experience compared to the classic layout.
Best practices when using this variable include:
- Consider the impact on user experience before enabling the card layout.
- Test thoroughly after changing the value to ensure all properties are displayed correctly.
- Be consistent across projects to maintain a uniform editing experience.
Regarding the associated variable CVarDetailsPanelEnableCardLayout:
The purpose of CVarDetailsPanelEnableCardLayout is to provide programmatic access to the DetailsPanel.Style.EnableCardLayout setting within the C++ code.
It’s used in the Property Editor module, specifically in the SDetailsView class, to determine which style key to return for the Details View.
The value is set when the console variable is initialized, but it can be changed at runtime through console commands.
This variable interacts directly with the GetPrimaryDetailsViewStyleKey() function of SDetailsView, which decides whether to return the card or classic style based on the variable’s value.
Developers should be aware that this variable can be accessed from any thread (as seen in the GetValueOnAnyThread() call), which means changes to it could potentially affect multiple parts of the editor simultaneously.
Best practices include:
- Use the GetValueOnAnyThread() method when accessing the value to ensure thread-safe operations.
- Consider the performance implications of frequently checking this value in performance-critical code paths.
- If changing the value at runtime, ensure all dependent UI elements are properly updated to reflect the new style.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Editor/PropertyEditor/Private/SDetailsView.cpp:33
Scope: file
Source code excerpt:
static TAutoConsoleVariable<bool> CVarDetailsPanelEnableCardLayout(
TEXT("DetailsPanel.Style.EnableCardLayout"),
false,
TEXT("Specifies whether the card layout is in effect for the Details View."),
ECVF_Default);
SDetailsView::~SDetailsView()
{
#Associated Variable and Callsites
This variable is associated with another variable named CVarDetailsPanelEnableCardLayout
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Editor/PropertyEditor/Private/SDetailsView.cpp:32
Scope: file
Source code excerpt:
#define LOCTEXT_NAMESPACE "SDetailsView"
static TAutoConsoleVariable<bool> CVarDetailsPanelEnableCardLayout(
TEXT("DetailsPanel.Style.EnableCardLayout"),
false,
TEXT("Specifies whether the card layout is in effect for the Details View."),
ECVF_Default);
SDetailsView::~SDetailsView()
#Loc: <Workspace>/Engine/Source/Editor/PropertyEditor/Private/SDetailsView.cpp:1565
Scope (from outer to inner):
file
function const FDetailsViewStyleKey& SDetailsView::GetPrimaryDetailsViewStyleKey
Source code excerpt:
const FDetailsViewStyleKey& SDetailsView::GetPrimaryDetailsViewStyleKey()
{
if (CVarDetailsPanelEnableCardLayout.GetValueOnAnyThread())
{
return FDetailsViewStyleKeys::Card();
}
return FDetailsViewStyleKeys::Classic();
}