extensions_ui: Remove dependency on theme_selector (#21023)

This PR removes the dependency on `theme_selector` from `extensions_ui`,
as we can just dispatch the action instead.

Release Notes:

- N/A
This commit is contained in:
Marshall Bowers 2024-11-21 16:48:25 -05:00 committed by GitHub
parent b102a40e04
commit af34953bc3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 12 deletions

1
Cargo.lock generated
View file

@ -4233,7 +4233,6 @@ dependencies = [
"smallvec",
"snippet_provider",
"theme",
"theme_selector",
"ui",
"util",
"vim_mode_setting",

View file

@ -38,7 +38,6 @@ settings.workspace = true
smallvec.workspace = true
snippet_provider.workspace = true
theme.workspace = true
theme_selector.workspace = true
ui.workspace = true
util.workspace = true
vim_mode_setting.workspace = true

View file

@ -17,9 +17,9 @@ use editor::{Editor, EditorElement, EditorStyle};
use extension_host::{ExtensionManifest, ExtensionOperation, ExtensionStore};
use fuzzy::{match_strings, StringMatchCandidate};
use gpui::{
actions, uniform_list, AppContext, EventEmitter, Flatten, FocusableView, InteractiveElement,
KeyContext, ParentElement, Render, Styled, Task, TextStyle, UniformListScrollHandle, View,
ViewContext, VisualContext, WeakView, WindowContext,
actions, uniform_list, Action, AppContext, EventEmitter, Flatten, FocusableView,
InteractiveElement, KeyContext, ParentElement, Render, Styled, Task, TextStyle,
UniformListScrollHandle, View, ViewContext, VisualContext, WeakView, WindowContext,
};
use num_format::{Locale, ToFormattedString};
use project::DirectoryLister;
@ -254,14 +254,13 @@ impl ExtensionsPage {
.collect::<Vec<_>>();
if !themes.is_empty() {
workspace
.update(cx, |workspace, cx| {
theme_selector::toggle(
workspace,
&zed_actions::theme_selector::Toggle {
.update(cx, |_workspace, cx| {
cx.dispatch_action(
zed_actions::theme_selector::Toggle {
themes_filter: Some(themes),
},
cx,
)
}
.boxed_clone(),
);
})
.ok();
}