Skip to content

Dynamic theme switching #30

@sudoker0

Description

@sudoker0

So, as it turns out, tgui does allow for dynamic theme switching by setting the default theme with tgui::Theme::setDefault(). The reason why some elements doesn't seems to be updated has been narrowed down to the use of getRenderer().

When a widget calls getRenderer(), the widget will generate it's own renderer copy, decoupling it's theme renderer from the shared theme renderer, making the widget unable to receive update when a theme is updated.

This is confirmed in commit df1979d, as removing the getRenderer calls for some widgets allows those widgets to be updated along the theme.

Metadata

Metadata

Assignees

Labels

long-termA long-term goal for this project

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions