Apply OS theme via native-theme on desktop
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user