Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
theme_selector: Fix mouse clicks not updating the theme properly (#40090)
Finn Eversce20e71abfa8
diff --git a/crates/theme_selector/src/theme_selector.rs b/crates/theme_selector/src/theme_selector.rsindex d3e21d5bd51..38e7fc33f7b 100644--- a/crates/theme_selector/src/theme_selector.rs+++ b/crates/theme_selector/src/theme_selector.rs@@ -7,7 +7,7 @@ use gpui::{Window, actions,};use picker::{Picker, PickerDelegate};-use settings::{SettingsStore, update_settings_file};+use settings::{Settings, SettingsStore, update_settings_file};use std::sync::Arc;use theme::{Appearance, Theme, ThemeMeta, ThemeRegistry, ThemeSettings};use ui::{ListItem, ListItemSpacing, prelude::*, v_flex};@@ -231,12 +231,11 @@ impl PickerDelegate for ThemeSelectorDelegate {) {self.selection_completed = true;- let theme_name = cx.theme().name.clone();+ let appearance = Appearance::from(window.appearance());+ let theme_name = ThemeSettings::get_global(cx).theme.name(appearance).0;telemetry::event!("Settings Changed", setting = "theme", value = theme_name);- let appearance = Appearance::from(window.appearance());-update_settings_file(self.fs.clone(), cx, move |settings, _| {theme::set_theme(settings, theme_name.to_string(), appearance);});