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 <git@maxdeviant.com>
This commit is contained in:
galuis116andMarshall Bowers authored and GitHub committed 2026-04-27 09:32:43 +00:00
1 parent b178949033
commit 7dfe0fb3a4
1 file changed
+8 -2
+8 -2
View File
@@ -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()
}
}
}
},
};