Add feature flags handling to the client, rewrite staff mode to a trait extension style

This commit is contained in:
Mikayla 2023-08-25 17:00:53 -07:00
parent 6fdf101745
commit 74565ed0b8
No known key found for this signature in database
18 changed files with 143 additions and 107 deletions

View file

@ -16,7 +16,7 @@ gpui = { path = "../gpui" }
picker = { path = "../picker" }
theme = { path = "../theme" }
settings = { path = "../settings" }
staff_mode = { path = "../staff_mode" }
feature_flags = { path = "../feature_flags" }
workspace = { path = "../workspace" }
util = { path = "../util" }
log.workspace = true

View file

@ -1,9 +1,9 @@
use feature_flags::FeatureFlagAppExt;
use fs::Fs;
use fuzzy::{match_strings, StringMatch, StringMatchCandidate};
use gpui::{actions, elements::*, AnyElement, AppContext, Element, MouseState, ViewContext};
use picker::{Picker, PickerDelegate, PickerEvent};
use settings::{update_settings_file, SettingsStore};
use staff_mode::StaffMode;
use std::sync::Arc;
use theme::{Theme, ThemeMeta, ThemeRegistry, ThemeSettings};
use util::ResultExt;
@ -54,7 +54,7 @@ impl ThemeSelectorDelegate {
fn new(fs: Arc<dyn Fs>, cx: &mut ViewContext<ThemeSelector>) -> Self {
let original_theme = theme::current(cx).clone();
let staff_mode = **cx.default_global::<StaffMode>();
let staff_mode = cx.is_staff();
let registry = cx.global::<Arc<ThemeRegistry>>();
let mut theme_names = registry.list(staff_mode).collect::<Vec<_>>();
theme_names.sort_unstable_by(|a, b| a.is_light.cmp(&b.is_light).then(a.name.cmp(&b.name)));