Apply OS theme via native-theme on desktop

This commit is contained in:
2026-10-21 21:09:00 +07:00
parent 6117c8184c
commit cab58f6332
7 changed files with 413 additions and 31 deletions
+8 -5
View File
@@ -88,12 +88,15 @@ impl Workspace {
let workspace = cx.entity().downgrade();
let mut subscriptions = smallvec![];
subscriptions.push(
// Observe system appearance and update theme
cx.observe_window_appearance(window, |_this, window, cx| {
// Follow OS appearance changes only when the user has not pinned a
// mode; the native-theme watcher drives runtime changes either way.
// The `::settings` path is the external crate; the crate-local
// `settings` module is the preferences dialog.
if ::settings::AppSettings::get_appearance_mode(cx) == ::settings::AppearanceMode::System {
subscriptions.push(cx.observe_window_appearance(window, |_this, window, cx| {
gpui_kit::component::Theme::sync_system_appearance(Some(window), cx);
}),
);
}));
}
subscriptions.push(
// Subscribe to the nostr events