This pull request removes more `Send` bounds from GPUI2 after #3206 and
simplifies some internals. Specifically:
- The `Reference` enum was removed, as we always capture mutable
references anyway.
- A few GATs from `Context` and `VisualContext` were removed, as they're
unnecessary now that `MainThread` isn't a thing.
- View rendering was greatly simplified (we were able to remove
`EraseViewState` and `ViewObject`)
Release Notes:
- N/A
The potential for deadlock and other complexity ended up convincing us
that the benefits of making the app state accessible from any thread
were not worth their cost. We probably could have gone back to the old
executors, but we decided to fix forward and continue to get the
benefits of the new dispatcher.
This PR adjusts the representations of `ColorScale`s to allow us to
remove an unsafe `From` impl when converting from the statically-defined
representation of the scale.
Release Notes:
- N/A
This PR adds a new `ui_font_size` setting that can be used to control
the scale of the entire UI.
We use the value in this setting to set the base rem size of the window.
Release Notes:
- N/A
This PR adjusts the individual color scale functions to return
`ColorScaleSet`s instead of `DefaultColorScaleSet`s.
We only use the `DefaultColorScaleSet`s to simplify the construction of
the scales, so it isn't necessary to surface them outside of the
function.
Release Notes:
- N/A
This PR updates the `ThemeStyles` struct to use the `Refineable` trait
instead of a custom declarative macro for generating refinements.
Release Notes:
- N/A
This PR removes the old `Theme` definition in favor of the new
`ThemeVariant`s.
The new `SyntaxStyles` have been reverted to the old `SyntaxTheme` that
operates by storing the syntax styles as a vector of
`gpui2::HighlightStyle`s.
This is necessary for the intended usage by `language2`, where we find
the longest key in the theme's syntax styles that matches the capture
name:
18431051d9/crates/language2/src/highlight_map.rs (L15-L41)
This PR reworks the theme definition in the `theme2` crate to be based
off of the new theme work that @iamnbutler has been working on.
We're still developing the new theme system, but it is complete enough
that we can now load the default theme and use it to theme the storybook
(albeit with some further refining of the color palette required).
---------
Co-authored-by: Nate Butler <iamnbutler@gmail.com>
Co-authored-by: Marshall Bowers <marshall@zed.dev>