class
CMiriStyle
Owns the registered style sets and tracks the active one
- Module
- Miri
- Header
#include "Miri/Style/CMiriStyle.h"- Namespace
Miri
Public functions
| Returns | Name | Description |
|---|---|---|
CMiriStyle& | Get | |
void | Initialize | |
void | RegisterStyleSet | |
void | SetActiveStyleSet | |
const CMiriStyleSet& | GetActiveStyleSet | Falls back to the built-in dark theme when no set is registered, so widgets can resolve style defaults before Initialize() runs |
const CMiriStyleSet* | FindStyleSet | |
MiriColor | GetColor | |
std::vector<std::string> | GetStyleSetNames | |
uint32_t | AddStyleSetChangedListener | Fires whenever the active style set changes identity or content: SetActiveStyleSet, and RegisterStyleSet when it replaces the active set (the style hot-reload path). |
void | RemoveStyleSetChangedListener | |
void | Shutdown | Drops every registered set (and their brush texture refs) plus all listeners. |
Function details
Get
C++
static CMiriStyle& Get()Initialize
C++
void Initialize()RegisterStyleSet
C++
void RegisterStyleSet(const std::string& name, CMiriStyleSet&& styleSet)SetActiveStyleSet
C++
void SetActiveStyleSet(const std::string& name)GetActiveStyleSet
C++
const CMiriStyleSet& GetActiveStyleSet() constFalls back to the built-in dark theme when no set is registered, so widgets can resolve style defaults before Initialize() runs
FindStyleSet
C++
const CMiriStyleSet* FindStyleSet(const std::string& name) constGetColor
C++
MiriColor GetColor(const std::string& key) constGetStyleSetNames
C++
std::vector<std::string> GetStyleSetNames() constAddStyleSetChangedListener
C++
uint32_t AddStyleSetChangedListener(std::function<void()> callback)Fires whenever the active style set changes identity or content: SetActiveStyleSet, and RegisterStyleSet when it replaces the active set (the style hot-reload path). Listeners must invalidate anything that cached a style-derived value — colors resolve per paint, but metrics feed the desired-size cache.
RemoveStyleSetChangedListener
C++
void RemoveStyleSetChangedListener(uint32_t handle)Shutdown
C++
void Shutdown()Drops every registered set (and their brush texture refs) plus all listeners. Must run before the RHI device is destroyed.
Generated from Miri/Style/CMiriStyle.h via miri.json · Dec 5, 2026Version 1.1.0