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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue