Define theme/ui text style settings in theme crate

This commit is contained in:
Max Brunsfeld
2023-05-17 14:44:59 -07:00
parent 5c729c0e56
commit 67a25126d4
86 changed files with 530 additions and 637 deletions
+2 -4
View File
@@ -19,7 +19,7 @@ use gpui::{
use language::LanguageRegistry;
use parking_lot::Mutex;
use project::{Project, WorktreeId};
use settings::{Settings, SettingsStore};
use settings::SettingsStore;
use std::{
cell::{Ref, RefCell, RefMut},
env,
@@ -30,7 +30,6 @@ use std::{
Arc,
},
};
use theme::ThemeRegistry;
use util::http::FakeHttpClient;
use workspace::Workspace;
@@ -103,7 +102,6 @@ impl TestServer {
async fn create_client(&mut self, cx: &mut TestAppContext, name: &str) -> TestClient {
cx.update(|cx| {
cx.set_global(SettingsStore::test(cx));
cx.set_global(Settings::test(cx));
});
let http = FakeHttpClient::with_404_response();
@@ -192,7 +190,6 @@ impl TestServer {
client: client.clone(),
user_store: user_store.clone(),
languages: Arc::new(LanguageRegistry::test()),
themes: ThemeRegistry::new((), cx.font_cache()),
fs: fs.clone(),
build_window_options: |_, _, _| Default::default(),
initialize_workspace: |_, _, _| unimplemented!(),
@@ -201,6 +198,7 @@ impl TestServer {
});
cx.update(|cx| {
theme::init((), cx);
Project::init(&client, cx);
client::init(&client, cx);
language::init(cx);
@@ -21,7 +21,7 @@ use rand::{
prelude::*,
};
use serde::{Deserialize, Serialize};
use settings::{Settings, SettingsStore};
use settings::SettingsStore;
use std::{
env,
ops::Range,
@@ -150,10 +150,8 @@ async fn test_random_collaboration(
for (client, mut cx) in clients {
cx.update(|cx| {
let store = cx.remove_global::<SettingsStore>();
let settings = cx.remove_global::<Settings>();
cx.clear_globals();
cx.set_global(store);
cx.set_global(settings);
drop(client);
});
}