UIModule
#include "GUI/UIModule.h"
Inherits from Module, IStateful
Public Functions
| Name | |
|---|---|
| UIModule() =default | |
| ~UIModule() override | |
| void | applyUIScaling(float scale)<br>Applies a UI/DPI scaling factor to the current Theme. |
| void | applyUIScalingNextFrame(float scale) |
| virtual void | clearGlobal() override<br>Set the global state to some default empty state. |
| FontManager & | getFontManager() |
| UISettings & | getSettings() |
| Theme & | getTheme() |
| std::optional< Theme * > | getThemeByName(const std::string & name) const |
| std::vector< Theme > & | getThemes() |
| float | getUiScale() const<br>Get the current UI scale, by default derived from main windows DPI scaling factor. |
| WindowManager & | getWindowManager() |
| virtual void | loadGlobal(const Memento & memento) override<br>Load global state from a memento. |
| void | loadThemes() |
| template <typename TStrategy > <br>void | openConfirmModal() |
| template <typename T > <br>void | openModal() |
| void | reloadThemes() |
| virtual Memento | saveGlobal() override<br>Save shared global state. |
| void | setDefaultTheme()<br>Set the theme to the default one based on the system settings (LightMode or DarkMode only on Windows). |
| void | setTheme(const Theme & theme) |
Friends
| Name | |
|---|---|
| class | Application |
Additional inherited members
Public Functions inherited from Module
| Name | |
|---|---|
| Module() =default | |
| virtual | ~Module() =default |
| virtual void | onEndFrame() |
| virtual void | onUpdate(double deltaSeconds) |
Public Functions inherited from IStateful
| Name | |
|---|---|
| virtual | ~IStateful() |
| Memento | emptyMemento()<br>Create an empty memento (rapidjson::Document) |
Public Functions Documentation
function UIModule
UIModule() =defaultUIModule() =defaultfunction ~UIModule
~UIModule() override~UIModule() overridefunction applyUIScaling
void applyUIScaling(
float scale
)void applyUIScaling(
float scale
)Applies a UI/DPI scaling factor to the current Theme.
Parameters:
- scale The new UI scaling factor.
Warning: This method cannot be called during ImGui drawing, eg. between NewFrame() and EndFrame/Render()! Use applyUIScalingNextFrame() instead for changes within UI code itself.
ImGuiStyle is reinitialized, the theme reapplied and fonts reloaded.
function applyUIScalingNextFrame
void applyUIScalingNextFrame(
float scale
)void applyUIScalingNextFrame(
float scale
)See: applyUIScaling()
function clearGlobal
virtual void clearGlobal() overridevirtual void clearGlobal() overrideSet the global state to some default empty state.
Reimplements: IStateful::clearGlobal
function getFontManager
inline FontManager & getFontManager()inline FontManager & getFontManager()function getSettings
UISettings & getSettings()UISettings & getSettings()function getTheme
inline Theme & getTheme()inline Theme & getTheme()function getThemeByName
std::optional< Theme * > getThemeByName(
const std::string & name
) conststd::optional< Theme * > getThemeByName(
const std::string & name
) constfunction getThemes
inline std::vector< Theme > & getThemes()inline std::vector< Theme > & getThemes()function getUiScale
float getUiScale() constfloat getUiScale() constGet the current UI scale, by default derived from main windows DPI scaling factor.
UI scale can be changed using applyUIScaling() or applyUIScalingNextFrame().
function getWindowManager
inline WindowManager & getWindowManager()inline WindowManager & getWindowManager()function loadGlobal
virtual void loadGlobal(
const Memento & memento
) overridevirtual void loadGlobal(
const Memento & memento
) overrideLoad global state from a memento.
Parameters:
- memento New global state
Reimplements: IStateful::loadGlobal
function loadThemes
void loadThemes()void loadThemes()function openConfirmModal
template <typename TStrategy >
inline void openConfirmModal()template <typename TStrategy >
inline void openConfirmModal()function openModal
template <typename T >
inline void openModal()template <typename T >
inline void openModal()function reloadThemes
void reloadThemes()void reloadThemes()function saveGlobal
virtual Memento saveGlobal() overridevirtual Memento saveGlobal() overrideSave shared global state.
Reimplements: IStateful::saveGlobal
function setDefaultTheme
void setDefaultTheme()void setDefaultTheme()Set the theme to the default one based on the system settings (LightMode or DarkMode only on Windows).
function setTheme
void setTheme(
const Theme & theme
)void setTheme(
const Theme & theme
)Friends
friend Application
friend class Application(
Application
);friend class Application(
Application
);Updated on 2026-05-21 at 15:39:35 +0000