fix(appearance): theme desync causing configs not to be set

This commit is contained in:
Michael Aaron Murphy 2025-08-12 21:48:37 +02:00
parent 505d6e5711
commit 4158c72b75
No known key found for this signature in database
GPG key ID: B2732D4240C9212C

View file

@ -175,9 +175,7 @@ impl Manager {
} }
let map_data_fn = |customizer: &ThemeCustomizer| { let map_data_fn = |customizer: &ThemeCustomizer| {
let builder = customizer.builder.0.clone(); (customizer.builder.0.clone(), customizer.theme.1.clone())
let (current_theme, config) = customizer.theme.clone();
(builder, current_theme, config)
}; };
let current = map_data_fn(if self.mode.0.is_dark { let current = map_data_fn(if self.mode.0.is_dark {
@ -199,12 +197,16 @@ impl Manager {
let mut data = std::iter::once(current).chain(other.into_iter()); let mut data = std::iter::once(current).chain(other.into_iter());
cosmic::task::future(async move { cosmic::task::future(async move {
while let Some((builder, current_theme, config)) = data.next() { while let Some((builder, config)) = data.next() {
if let Some(config) = config { if let Some(config) = config {
let current_theme = match Theme::get_entry(&config) {
Ok(theme) => theme,
Err((_errs, theme)) => theme,
};
let new_theme = builder.build(); let new_theme = builder.build();
theme_transaction!(config, current_theme, new_theme, { theme_transaction!(config, current_theme, new_theme, {
accent; accent;
accent_text;
accent_button; accent_button;
background; background;
button; button;
@ -221,6 +223,7 @@ impl Manager {
warning; warning;
warning_button; warning_button;
window_hint; window_hint;
accent_text;
}); });
} }
} }