Fix previous theme not being applied on startup

This commit is contained in:
Kirill Bulatov 2024-01-16 11:23:34 +02:00
parent ec3cfc33d6
commit 074966427d

View file

@ -62,6 +62,10 @@ pub enum LoadThemes {
pub fn init(themes_to_load: LoadThemes, cx: &mut AppContext) { pub fn init(themes_to_load: LoadThemes, cx: &mut AppContext) {
cx.set_global(ThemeRegistry::default()); cx.set_global(ThemeRegistry::default());
match themes_to_load {
LoadThemes::JustBase => (),
LoadThemes::All => cx.global_mut::<ThemeRegistry>().load_user_themes(),
}
ThemeSettings::register(cx); ThemeSettings::register(cx);
let mut prev_buffer_font_size = ThemeSettings::get_global(cx).buffer_font_size; let mut prev_buffer_font_size = ThemeSettings::get_global(cx).buffer_font_size;
@ -73,11 +77,6 @@ pub fn init(themes_to_load: LoadThemes, cx: &mut AppContext) {
} }
}) })
.detach(); .detach();
match themes_to_load {
LoadThemes::JustBase => (),
LoadThemes::All => cx.global_mut::<ThemeRegistry>().load_user_themes(),
}
} }
pub trait ActiveTheme { pub trait ActiveTheme {