zed/crates/workspace
Marshall Bowers c322179bb9
Initialize the SystemAppearance using the app's global window appearance (#7508)
This PR changes our approach to initializing the `SystemAppearance` so
that we can do it earlier in the startup process.

Previously we were using the appearance from the window, meaning that we
couldn't initialize the value until we first opened the window.

Now we read the `window_appearance` from the `AppContext`. On macOS this
is backed by the
[`effectiveAppearance`](https://developer.apple.com/documentation/appkit/nsapplication/2967171-effectiveappearance)
on the `NSApplication`.

We currently still watch for changes to the appearance at the window
level, as the only hook I could find in the documentation is
[`viewDidChangeEffectiveAppearance`](https://developer.apple.com/documentation/appkit/nsview/2977088-viewdidchangeeffectiveappearance),
which is at the `NSView` level.

In my testing this makes it so Zed appropriately chooses the correct
light/dark theme on startup.

Release Notes:

- N/A
2024-02-07 11:51:18 -05:00
..
src Initialize the SystemAppearance using the app's global window appearance (#7508) 2024-02-07 11:51:18 -05:00
Cargo.toml chore: Move workspace dependencies to workspace.dependencies (#7454) 2024-02-06 20:41:36 +01:00
LICENSE-GPL chore: Change AGPL-licensed crates to GPL (except for collab) (#4231) 2024-01-24 00:26:58 +01:00