From 047a8376ee741f962c178d80c1472378b7c890fd Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Thu, 26 Oct 2023 13:06:55 -0400 Subject: [PATCH] fix: apply the system theme change when updating the mode --- src/app/cosmic.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/app/cosmic.rs b/src/app/cosmic.rs index edda1a6e..64e5188f 100644 --- a/src/app/cosmic.rs +++ b/src/app/cosmic.rs @@ -334,12 +334,14 @@ impl Cosmic { let changed = core.system_theme_mode.is_dark != mode.is_dark; core.system_theme_mode = mode; if changed { + let new_theme = crate::theme::system_preference(); + core.system_theme = new_theme.clone(); THEME.with(move |t| { let mut cosmic_theme = t.borrow_mut(); // Only apply update if the theme is set to load a system theme if let ThemeType::System(_) = cosmic_theme.theme_type { - cosmic_theme.set_theme(crate::theme::system_preference().theme_type); + cosmic_theme.set_theme(new_theme.theme_type); } }); }