Parameterize theme2::init to allow loading just the base theme (#3345)

This PR adds a parameter to the `theme2::init` method to indicate what
the theme-loading behavior should be.

This allows us to indicate when we want to load all of the additional
built-in user themes (like in the Zed binary and in the storybook), and
when we don't want to load the user themes (like in tests).

We're using an enum over just a `bool` here for clarity at the call
site.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2023-11-16 13:03:30 -05:00 committed by GitHub
parent 2aa7c6f2b4
commit b559bfd80f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 36 additions and 17 deletions

View file

@ -456,7 +456,7 @@ mod tests {
fn init_test(cx: &mut TestAppContext) -> Arc<AppState> {
cx.update(|cx| {
let app_state = AppState::test(cx);
theme::init(cx);
theme::init(theme::LoadThemes::JustBase, cx);
language::init(cx);
editor::init(cx);
workspace::init(app_state.clone(), cx);