WindowTitleBar.ForceWindowButtonsHidden
WindowTitleBar.ForceWindowButtonsHidden
#Overview
name: WindowTitleBar.ForceWindowButtonsHidden
This variable is created as a Console Variable (cvar).
- type:
Var
- help:
If true, force the window title bar buttons to be hidden.
It is referenced in 3
C++ source files.
#Summary
#Usage in the C++ source code
The purpose of WindowTitleBar.ForceWindowButtonsHidden is to control the visibility of window title bar buttons in the Unreal Engine 5 user interface system. This setting variable is specifically used for managing the appearance of window controls in the UI.
This setting variable is primarily used in the UMG (Unreal Motion Graphics) module, which is responsible for creating and managing user interfaces in Unreal Engine 5. Based on the callsites, it’s clear that this variable is utilized within the WindowTitleBarArea component of the UMG system.
The value of this variable is set as a console variable (CVar) using the TAutoConsoleVariable class. It is initialized with a default value of false, meaning that by default, the window buttons are not hidden.
The associated variable CVarForceWindowButtonsHidden directly interacts with WindowTitleBar.ForceWindowButtonsHidden. They share the same value and purpose, with CVarForceWindowButtonsHidden being the C++ representation of the console variable.
Developers must be aware that this variable can override the visibility setting of window buttons regardless of other UI configurations. When set to true, it will force the window title bar buttons to be hidden, potentially affecting the user’s ability to interact with window controls.
Best practices when using this variable include:
- Use it sparingly and only when necessary to maintain a consistent UI experience across different platforms or game states.
- Document its usage clearly in the project, as it can have a significant impact on the user interface.
- Consider the implications on user experience and accessibility when hiding window controls.
Regarding the associated variable CVarForceWindowButtonsHidden:
The purpose of CVarForceWindowButtonsHidden is to provide a programmatic way to access and modify the WindowTitleBar.ForceWindowButtonsHidden setting within C++ code.
This variable is used within the UMG module, specifically in the WindowTitleBarArea component. It allows developers to check and set the visibility of window buttons at runtime.
The value of CVarForceWindowButtonsHidden is set through the console variable system, which means it can be modified via console commands or configuration files.
CVarForceWindowButtonsHidden directly interacts with the WindowTitleBar.ForceWindowButtonsHidden console variable, effectively serving as its C++ interface.
Developers should be aware that changes to CVarForceWindowButtonsHidden will immediately affect the UI, potentially causing unexpected behavior if not managed properly.
Best practices for using CVarForceWindowButtonsHidden include:
- Use GetValueOnAnyThread() to safely access its value from any thread.
- Consider caching the value if it’s accessed frequently to improve performance.
- Use it in conjunction with other UI configuration options to create a cohesive user interface experience.
#References in C++ code
#Callsites
This variable is referenced in the following C++ source code:
#Loc: <Workspace>/Engine/Source/Runtime/UMG/Private/Components/WindowTitleBarArea.cpp:15
Scope (from outer to inner):
file
namespace UE::UMG::Private
Source code excerpt:
{
static TAutoConsoleVariable<bool> CVarForceWindowButtonsHidden(
TEXT("WindowTitleBar.ForceWindowButtonsHidden"),
false,
TEXT("If true, force the window title bar buttons to be hidden."),
ECVF_Default);
}
#define LOCTEXT_NAMESPACE "UMG"
#Associated Variable and Callsites
This variable is associated with another variable named CVarForceWindowButtonsHidden
. They share the same value. See the following C++ source code.
#Loc: <Workspace>/Engine/Source/Runtime/UMG/Private/Components/WindowTitleBarArea.cpp:14
Scope (from outer to inner):
file
namespace UE::UMG::Private
Source code excerpt:
namespace UE::UMG::Private
{
static TAutoConsoleVariable<bool> CVarForceWindowButtonsHidden(
TEXT("WindowTitleBar.ForceWindowButtonsHidden"),
false,
TEXT("If true, force the window title bar buttons to be hidden."),
ECVF_Default);
}
#Loc: <Workspace>/Engine/Source/Runtime/UMG/Private/Components/WindowTitleBarArea.cpp:76
Scope (from outer to inner):
file
function TSharedRef<SWidget> UWindowTitleBarArea::RebuildWidget
Source code excerpt:
PRAGMA_DISABLE_DEPRECATION_WARNINGS
MyWindowTitleBarArea->SetWindowButtonsVisibility(UE::UMG::Private::CVarForceWindowButtonsHidden.GetValueOnAnyThread() ? false : bWindowButtonsEnabled);
PRAGMA_ENABLE_DEPRECATION_WARNINGS
return MyWindowTitleBarArea.ToSharedRef();
}
UClass* UWindowTitleBarArea::GetSlotClass() const