class

CMiriStyle

Owns the registered style sets and tracks the active one

Module
Miri
Header
#include "Miri/Style/CMiriStyle.h"
Namespace
Miri

Public functions

ReturnsNameDescription
CMiriStyle&Get
voidInitialize
voidRegisterStyleSet
voidSetActiveStyleSet
const CMiriStyleSet&GetActiveStyleSetFalls back to the built-in dark theme when no set is registered, so widgets can resolve style defaults before Initialize() runs
const CMiriStyleSet*FindStyleSet
MiriColorGetColor
std::vector<std::string>GetStyleSetNames
uint32_tAddStyleSetChangedListenerFires whenever the active style set changes identity or content: SetActiveStyleSet, and RegisterStyleSet when it replaces the active set (the style hot-reload path).
voidRemoveStyleSetChangedListener
voidShutdownDrops 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() const

Falls 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) const

GetColor

C++
MiriColor GetColor(const std::string& key) const

GetStyleSetNames

C++
std::vector<std::string> GetStyleSetNames() const

AddStyleSetChangedListener

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