Added experimental themes flag

This commit is contained in:
Mikayla Maki 2022-09-08 15:47:27 -07:00
parent d881320345
commit 2b4db9b16e
12 changed files with 87 additions and 27 deletions

View file

@ -70,7 +70,6 @@ fn main() {
.await
.map(|github| {
&github == "as-cii"
|| &github == "ForLoveOfCats"
|| &github == "ForLoveOfCats"
|| &github == "gibusu"
|| &github == "iamnbutler"
@ -85,7 +84,7 @@ fn main() {
}
});
let themes = ThemeRegistry::new(Assets, app.font_cache(), internal);
let themes = ThemeRegistry::new(Assets, app.font_cache());
let default_settings = Settings::defaults(Assets, &app.font_cache(), &themes);
let config_files = load_config_files(&app, fs.clone());
@ -127,9 +126,12 @@ fn main() {
let fs = fs.clone();
async move {
while let Some(user) = current_user.recv().await {
let user_name = user
.map(|user| user.github_login.clone())
.unwrap_or_else(|| String::new());
// When the user logs out, `user` is None.
if user.is_none() {
continue;
}
let user_name = user.unwrap().github_login.clone();
fs.save(
&*zed::paths::LAST_USERNAME,

View file

@ -153,7 +153,7 @@ mod tests {
watch_settings_file(
default_settings.clone(),
source,
ThemeRegistry::new((), font_cache, false),
ThemeRegistry::new((), font_cache),
false,
cx,
)

View file

@ -244,7 +244,13 @@ pub fn initialize_workspace(
cx.emit(workspace::Event::PaneAdded(workspace.active_pane().clone()));
let theme_names = app_state.themes.list().map(|meta| meta.name).collect();
let settings = cx.global::<Settings>();
let theme_names = app_state
.themes
.list(settings.internal, settings.experiments.experimental_themes)
.map(|meta| meta.name)
.collect();
let language_names = &languages::LANGUAGE_NAMES;
workspace.project().update(cx, |project, cx| {
@ -1664,11 +1670,11 @@ mod tests {
.into(),
])
.unwrap();
let themes = ThemeRegistry::new(Assets, cx.font_cache().clone(), false);
let themes = ThemeRegistry::new(Assets, cx.font_cache().clone());
let settings = Settings::defaults(Assets, cx.font_cache(), &themes);
let mut has_default_theme = false;
for theme_name in themes.list().map(|meta| meta.name) {
for theme_name in themes.list(false, false).map(|meta| meta.name) {
let theme = themes.get(&theme_name).unwrap();
if theme.meta.name == settings.theme.meta.name {
has_default_theme = true;