theme: Turn ThemeRegistry
into a trait (#20076)
This PR converts the `ThemeRegistry` type into a trait instead of a concrete implementation. This allows for the extension store to depend on an abstraction rather than the concrete theme registry implementation. We currently have two `ThemeRegistry` implementations: - `RealThemeRegistry` — this was previously the `ThemeRegistry` and contains the real implementation of the registry. - `VoidThemeRegistry` — a null object that doesn't have any behavior. Release Notes: - N/A
This commit is contained in:
parent
c04c439d23
commit
af9e7f1f96
13 changed files with 184 additions and 118 deletions
|
@ -76,7 +76,7 @@ fn main() {
|
|||
|
||||
let selector = story_selector;
|
||||
|
||||
let theme_registry = ThemeRegistry::global(cx);
|
||||
let theme_registry = <dyn ThemeRegistry>::global(cx);
|
||||
let mut theme_settings = ThemeSettings::get_global(cx).clone();
|
||||
theme_settings.active_theme = theme_registry.get(&theme_name).unwrap();
|
||||
ThemeSettings::override_global(theme_settings, cx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue