UOperatingSystemSettingModule_Theme
#include <OperatingSystemSimulator/Public/Programs/Settings/Modules/OperatingSystemSettingModule_Theme.h>class UOperatingSystemSettingModule_ThemeDefined in OperatingSystemSettingModule_Theme.h:13
Inherits:
UOperatingSystemSettingModule
Inheritance diagram
Section titled “Inheritance diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemSettingModule_Theme["UOperatingSystemSettingModule_Theme"]
class UOperatingSystemSettingModule["UOperatingSystemSettingModule"]
UOperatingSystemSettingModule <|-- UOperatingSystemSettingModule_Theme
Collaboration diagram
Section titled “Collaboration diagram”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemSettingModule_Theme["UOperatingSystemSettingModule_Theme"]
class EOperatingSystemTheme["EOperatingSystemTheme"]
UOperatingSystemSettingModule_Theme ..> EOperatingSystemTheme
Class detail
Section titled “Class detail”---
config:
class:
hideEmptyMembersBox: true
---
classDiagram
class UOperatingSystemSettingModule_Theme {
+UOperatingSystemSettingModule_Theme()
+SetTheme(const EOperatingSystemTheme NewTheme)
+GetPrimaryThemeColor(const bool bInvert=false) const FLinearColor
+GetSecondaryThemeColor(const bool bInvert=false) const FLinearColor
+GetPrimaryAccentColor(const bool bInvert=false) const FLinearColor
+GetSecondaryAccentColor(const bool bInvert=false) const FLinearColor
+FindColorByName(const FName Name, FLinearColor &OutColor) c bool
+IsDarkTheme() const bool
+GetThemeChangeEventName() FName
+Colors : TMap< FName, FLinearColor >
+CurrentTheme : EOperatingSystemTheme()
}
UOperatingSystemSettingModule_Theme is a subclass of UOperatingSystemSettingModule that provides functionality for managing and retrieving theme-related settings.
Public Methods
Section titled “Public Methods”| Return | Name | Description |
|---|---|---|
UOperatingSystemSettingModule_Theme | ||
void | SetTheme | Sets the current theme. |
FLinearColor | GetPrimaryThemeColor const | Returns the primary theme color. |
FLinearColor | GetSecondaryThemeColor const | Returns the secondary theme color. |
FLinearColor | GetPrimaryAccentColor const | Returns the primary accent color. |
FLinearColor | GetSecondaryAccentColor const | Returns the secondary accent color. |
bool | FindColorByName const | Gets the color by name from the Colors TMap. This is particularly useful if you added your own custom colors. |
bool | IsDarkTheme const inline | Checks if the current theme is dark or not. If this function returns false, it means current theme is light. |
UOperatingSystemSettingModule_Theme
Section titled “UOperatingSystemSettingModule_Theme”UOperatingSystemSettingModule_Theme()Defined in OperatingSystemSettingModule_Theme.h:38
References
Section titled “References”SetTheme
Section titled “SetTheme”void SetTheme(const EOperatingSystemTheme NewTheme)Defined in OperatingSystemSettingModule_Theme.h:55 Sets the current theme.
Parameters
Section titled “Parameters”NewThemeNew theme to set.
References
Section titled “References”GetPrimaryThemeColor
Section titled “GetPrimaryThemeColor”const
FLinearColor GetPrimaryThemeColor(const bool bInvert = false) constDefined in OperatingSystemSettingModule_Theme.h:64 Returns the primary theme color.
Parameters
Section titled “Parameters”bInvertGet color of inverted theme. If current theme is dark, this will return color for light theme.
Returns
Section titled “Returns”Primary color of the current theme as defined in Colors parameter.
References
Section titled “References”ColorsCurrentThemeDark
GetSecondaryThemeColor
Section titled “GetSecondaryThemeColor”const
FLinearColor GetSecondaryThemeColor(const bool bInvert = false) constDefined in OperatingSystemSettingModule_Theme.h:73 Returns the secondary theme color.
Parameters
Section titled “Parameters”bInvertGet color of inverted theme. If current theme is dark, this will return color for light theme.
Returns
Section titled “Returns”Secondary color of the current theme as defined in Colors parameter.
References
Section titled “References”ColorsCurrentThemeDark
GetPrimaryAccentColor
Section titled “GetPrimaryAccentColor”const
FLinearColor GetPrimaryAccentColor(const bool bInvert = false) constDefined in OperatingSystemSettingModule_Theme.h:82 Returns the primary accent color.
Parameters
Section titled “Parameters”bInvertGet color of inverted theme. If current theme is dark, this will return color for light theme.
Returns
Section titled “Returns”Primary accent color of the current theme as defined in Colors parameter.
References
Section titled “References”ColorsCurrentThemeDark
GetSecondaryAccentColor
Section titled “GetSecondaryAccentColor”const
FLinearColor GetSecondaryAccentColor(const bool bInvert = false) constDefined in OperatingSystemSettingModule_Theme.h:91 Returns the secondary accent color.
Parameters
Section titled “Parameters”bInvertGet color of inverted theme. If current theme is dark, this will return color for light theme.
Returns
Section titled “Returns”Secondary accent color of the current theme as defined in Colors parameter.
References
Section titled “References”ColorsCurrentThemeDark
FindColorByName
Section titled “FindColorByName”const
bool FindColorByName(const FName Name, FLinearColor & OutColor) constDefined in OperatingSystemSettingModule_Theme.h:102 Gets the color by name from the Colors TMap. This is particularly useful if you added your own custom colors.
Parameters
Section titled “Parameters”-
NameName of the color to find. -
OutColorOutputs the color or Black if invalid.
Returns
Section titled “Returns”True if the given color name was found in Colors Map.
References
Section titled “References”IsDarkTheme
Section titled “IsDarkTheme”const inline
inline bool IsDarkTheme() constDefined in OperatingSystemSettingModule_Theme.h:110 Checks if the current theme is dark or not. If this function returns false, it means current theme is light.
Returns
Section titled “Returns”True if the current theme is dark.
References
Section titled “References”Dark
Public Static Methods
Section titled “Public Static Methods”| Return | Name | Description |
|---|---|---|
FName | GetThemeChangeEventName static inline | A helper static function for getting the event when changing themes. You can listen to this event name via device messenger. |
GetThemeChangeEventName
Section titled “GetThemeChangeEventName”static inline
static inline FName GetThemeChangeEventName()Defined in OperatingSystemSettingModule_Theme.h:47 A helper static function for getting the event when changing themes. You can listen to this event name via device messenger.
Returns
Section titled “Returns”The event name when changing theme.
Referenced by
Section titled “Referenced by”Private Attributes
Section titled “Private Attributes”| Return | Name | Description |
|---|---|---|
TMap< FName, FLinearColor > | Colors | Colors is a TMap variable that stores a collection of FName keys mapped to FLinearColor values. These colors are used to define the theme-related settings in the operating system. |
EOperatingSystemTheme | CurrentTheme | CurrentTheme is a variable of type EOperatingSystemTheme that represents the current theme in the operating system. The theme can be either light or dark, as defined in the enum EOperatingSystemTheme. By default, the theme is set to EOperatingSystemTheme::Light. |
Colors
Section titled “Colors”TMap< FName, FLinearColor > ColorsDefined in OperatingSystemSettingModule_Theme.h:24 Colors is a TMap variable that stores a collection of FName keys mapped to FLinearColor values. These colors are used to define the theme-related settings in the operating system.
The keys in Colors represent the names of the colors, and the values represent the actual color values.
Referenced by
Section titled “Referenced by”FindColorByNameGetPrimaryAccentColorGetPrimaryThemeColorGetSecondaryAccentColorGetSecondaryThemeColorUOperatingSystemSettingModule_Theme
CurrentTheme
Section titled “CurrentTheme”EOperatingSystemTheme CurrentThemeDefined in OperatingSystemSettingModule_Theme.h:34 CurrentTheme is a variable of type EOperatingSystemTheme that represents the current theme in the operating system. The theme can be either light or dark, as defined in the enum EOperatingSystemTheme. By default, the theme is set to EOperatingSystemTheme::Light.
To change the current theme, use the SetTheme function.