This PR reverts #20076 to turn the `ThemeRegistry` back into a regular struct again. It doesn't actually help us by having it behind a trait. Release Notes: - N/A
This commit is contained in:
parent
4084ba36f9
commit
273173ec8a
12 changed files with 89 additions and 151 deletions
|
@ -407,7 +407,7 @@ fn main() {
|
|||
app_state.client.clone(),
|
||||
app_state.node_runtime.clone(),
|
||||
app_state.languages.clone(),
|
||||
<dyn ThemeRegistry>::global(cx),
|
||||
ThemeRegistry::global(cx),
|
||||
cx,
|
||||
);
|
||||
recent_projects::init(cx);
|
||||
|
@ -1160,9 +1160,8 @@ fn load_user_themes_in_background(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {
|
|||
cx.spawn({
|
||||
let fs = fs.clone();
|
||||
|cx| async move {
|
||||
if let Some(theme_registry) = cx
|
||||
.update(|cx| <dyn ThemeRegistry>::global(cx).clone())
|
||||
.log_err()
|
||||
if let Some(theme_registry) =
|
||||
cx.update(|cx| ThemeRegistry::global(cx).clone()).log_err()
|
||||
{
|
||||
let themes_dir = paths::themes_dir().as_ref();
|
||||
match fs
|
||||
|
@ -1201,9 +1200,8 @@ fn watch_themes(fs: Arc<dyn fs::Fs>, cx: &mut AppContext) {
|
|||
while let Some(paths) = events.next().await {
|
||||
for event in paths {
|
||||
if fs.metadata(&event.path).await.ok().flatten().is_some() {
|
||||
if let Some(theme_registry) = cx
|
||||
.update(|cx| <dyn ThemeRegistry>::global(cx).clone())
|
||||
.log_err()
|
||||
if let Some(theme_registry) =
|
||||
cx.update(|cx| ThemeRegistry::global(cx).clone()).log_err()
|
||||
{
|
||||
if let Some(()) = theme_registry
|
||||
.load_user_theme(&event.path, fs.clone())
|
||||
|
|
|
@ -1139,7 +1139,7 @@ mod tests {
|
|||
path::{Path, PathBuf},
|
||||
time::Duration,
|
||||
};
|
||||
use theme::{RealThemeRegistry, ThemeRegistry, ThemeSettings};
|
||||
use theme::{ThemeRegistry, ThemeSettings};
|
||||
use workspace::{
|
||||
item::{Item, ItemHandle},
|
||||
open_new, open_paths, pane, NewFile, OpenVisible, SaveIntent, SplitDirection,
|
||||
|
@ -3419,7 +3419,7 @@ mod tests {
|
|||
.unwrap(),
|
||||
])
|
||||
.unwrap();
|
||||
let themes = RealThemeRegistry::default();
|
||||
let themes = ThemeRegistry::default();
|
||||
settings::init(cx);
|
||||
theme::init(theme::LoadThemes::JustBase, cx);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue