From 7dfe0fb3a4f4fb1c0a0bc580f0faaa8671b77bad Mon Sep 17 00:00:00 2001 From: galuis116 <116897328+galuis116@users.noreply.github.com> Date: Mon, 27 Apr 2026 02:32:43 -0700 Subject: [PATCH] settings_ui: Fix switching icon themes from "dynamic" to "static" always selecting the dark theme (#54647) Self-Review Checklist: - [x] I've reviewed my own diff for quality, security, and reliability - [x] Unsafe blocks (if any) have justifying comments - [x] The content is consistent with the [UI/UX checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) - [x] Tests cover the new/changed behavior - [x] Performance impact has been considered and is acceptable Closes #54646 Release Notes: - Fixed settings behavior where switching Icon Theme from "Dynamic" (System mode) to "Static" now selects the icon theme that matches the current OS appearance (light or dark), instead of always defaulting to the dark variant. --------- Co-authored-by: Marshall Bowers --- crates/settings_ui/src/page_data.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/crates/settings_ui/src/page_data.rs b/crates/settings_ui/src/page_data.rs index 5b43d0a184..99dd77b84a 100644 --- a/crates/settings_ui/src/page_data.rs +++ b/crates/settings_ui/src/page_data.rs @@ -622,7 +622,7 @@ fn appearance_page() -> SettingsPage { .as_ref()? .discriminant() as usize]) }, - write: |settings_content, value, _| { + write: |settings_content, value, app| { let Some(value) = value else { settings_content.theme.icon_theme = None; return; @@ -638,7 +638,13 @@ fn appearance_page() -> SettingsPage { match mode { theme_settings::ThemeAppearanceMode::Light => light.clone(), theme_settings::ThemeAppearanceMode::Dark => dark.clone(), - theme_settings::ThemeAppearanceMode::System => dark.clone(), // no cx, can't determine correct choice + theme_settings::ThemeAppearanceMode::System => { + if SystemAppearance::global(app).is_light() { + light.clone() + } else { + dark.clone() + } + } } }, };