Skip to content

Theme plugin system#8153

Draft
AdrienZianne wants to merge 82 commits into
emilk:mainfrom
AdrienZianne:theme_plugin
Draft

Theme plugin system#8153
AdrienZianne wants to merge 82 commits into
emilk:mainfrom
AdrienZianne:theme_plugin

Conversation

@AdrienZianne
Copy link
Copy Markdown
Contributor

@AdrienZianne AdrienZianne commented May 12, 2026

What it does

Addition of a new system of theme plugins which allow the user to use different rules engine to compute the style for the available specialised widget style.

How to use

Create a engine implementing the trait ThemePlugin and ThemeStyle<S: StyleStruct> and implement the necessary methods, then register this way (example for ButtonStyle):
ui.add_theme::<ButtonStyle>(&mycustomengine);

Now all button will call the ThemeStyle<ButtonStyle> method to compute the correct style and later use the cached value to avoid the costly computation.

If no valid ThemeStyle<S> or engine is available then it fallback to the default style.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 12, 2026

Preview available at https://egui-pr-preview.github.io/pr/8153-themeplugin
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

View snapshot changes at kitdiff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant