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:
@@ -1891,6 +1891,6 @@ mod tests {
|
||||
fn init_test(cx: &mut AppContext) {
|
||||
let store = SettingsStore::test(cx);
|
||||
cx.set_global(store);
|
||||
theme::init(cx);
|
||||
theme::init(theme::LoadThemes::JustBase, cx);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8277,7 +8277,7 @@ pub(crate) fn init_test(cx: &mut TestAppContext, f: fn(&mut AllLanguageSettingsC
|
||||
cx.update(|cx| {
|
||||
let store = SettingsStore::test(cx);
|
||||
cx.set_global(store);
|
||||
theme::init(cx);
|
||||
theme::init(theme::LoadThemes::JustBase, cx);
|
||||
client::init_settings(cx);
|
||||
language::init(cx);
|
||||
Project::init_settings(cx);
|
||||
|
||||
@@ -3179,7 +3179,7 @@ all hints should be invalidated and requeried for all of its visible excerpts"
|
||||
cx.update(|cx| {
|
||||
let settings_store = SettingsStore::test(cx);
|
||||
cx.set_global(settings_store);
|
||||
theme::init(cx);
|
||||
theme::init(theme::LoadThemes::JustBase, cx);
|
||||
client::init_settings(cx);
|
||||
language::init(cx);
|
||||
Project::init_settings(cx);
|
||||
|
||||
Reference in New Issue
Block a user