Skip to content

UIModule ​

#include "GUI/UIModule.h"

Inherits from Module, IStateful

Public Functions ​

Name
UIModule() =default
~UIModule() override
voidapplyUIScaling(float scale)<br>Applies a UI/DPI scaling factor to the current Theme.
voidapplyUIScalingNextFrame(float scale)
virtual voidclearGlobal() 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()
floatgetUiScale() const<br>Get the current UI scale, by default derived from main windows DPI scaling factor.
WindowManager &getWindowManager()
virtual voidloadGlobal(const Memento & memento) override<br>Load global state from a memento.
voidloadThemes()
template <typename TStrategy &gt; <br>voidopenConfirmModal()
template <typename T &gt; <br>voidopenModal()
voidreloadThemes()
virtual MementosaveGlobal() override<br>Save shared global state.
voidsetDefaultTheme()<br>Set the theme to the default one based on the system settings (LightMode or DarkMode only on Windows).
voidsetTheme(const Theme & theme)

Friends ​

Name
classApplication

Additional inherited members ​

Public Functions inherited from Module

Name
Module() =default
virtual~Module() =default
virtual voidonEndFrame()
virtual voidonUpdate(double deltaSeconds)

Public Functions inherited from IStateful

Name
virtual~IStateful()
MementoemptyMemento()<br>Create an empty memento (rapidjson::Document)

Public Functions Documentation ​

function UIModule ​

cpp
UIModule() =default

function ~UIModule ​

cpp
~UIModule() override

function applyUIScaling ​

cpp
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 ​

cpp
void applyUIScalingNextFrame(
    float scale
)

See: applyUIScaling()

function clearGlobal ​

cpp
virtual void clearGlobal() override

Set the global state to some default empty state.

Reimplements: IStateful::clearGlobal

function getFontManager ​

cpp
inline FontManager & getFontManager()

function getSettings ​

cpp
UISettings & getSettings()

function getTheme ​

cpp
inline Theme & getTheme()

function getThemeByName ​

cpp
std::optional< Theme * > getThemeByName(
    const std::string & name
) const

function getThemes ​

cpp
inline std::vector< Theme > & getThemes()

function getUiScale ​

cpp
float getUiScale() const

Get the current UI scale, by default derived from main windows DPI scaling factor.

UI scale can be changed using applyUIScaling() or applyUIScalingNextFrame().

function getWindowManager ​

cpp
inline WindowManager & getWindowManager()

function loadGlobal ​

cpp
virtual void loadGlobal(
    const Memento & memento
) override

Load global state from a memento.

Parameters:

  • memento New global state

Reimplements: IStateful::loadGlobal

function loadThemes ​

cpp
void loadThemes()

function openConfirmModal ​

cpp
template <typename TStrategy >
inline void openConfirmModal()

function openModal ​

cpp
template <typename T >
inline void openModal()

function reloadThemes ​

cpp
void reloadThemes()

function saveGlobal ​

cpp
virtual Memento saveGlobal() override

Save shared global state.

Reimplements: IStateful::saveGlobal

function setDefaultTheme ​

cpp
void setDefaultTheme()

Set the theme to the default one based on the system settings (LightMode or DarkMode only on Windows).

function setTheme ​

cpp
void setTheme(
    const Theme & theme
)

Friends ​

friend Application ​

cpp
friend class Application(
    Application 
);

Updated on 2026-09-11 at 21:24:24 +0000