theme_selector: Add a button to open the extension store (#24195)
Adds a button to the theme selector to help people find more themes in the extension store.  Release Notes: - Added a way to access the extension store from the theme selector to make it easier to find new themes.
This commit is contained in:
parent
88b485f5cc
commit
a0269aba77
1 changed files with 30 additions and 0 deletions
|
@ -13,6 +13,7 @@ use theme::{Appearance, Theme, ThemeMeta, ThemeRegistry, ThemeSettings};
|
||||||
use ui::{prelude::*, v_flex, ListItem, ListItemSpacing};
|
use ui::{prelude::*, v_flex, ListItem, ListItemSpacing};
|
||||||
use util::ResultExt;
|
use util::ResultExt;
|
||||||
use workspace::{ui::HighlightedLabel, ModalView, Workspace};
|
use workspace::{ui::HighlightedLabel, ModalView, Workspace};
|
||||||
|
use zed_actions::Extensions;
|
||||||
|
|
||||||
use crate::icon_theme_selector::{IconThemeSelector, IconThemeSelectorDelegate};
|
use crate::icon_theme_selector::{IconThemeSelector, IconThemeSelectorDelegate};
|
||||||
|
|
||||||
|
@ -321,4 +322,33 @@ impl PickerDelegate for ThemeSelectorDelegate {
|
||||||
)),
|
)),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn render_footer(
|
||||||
|
&self,
|
||||||
|
_: &mut Window,
|
||||||
|
cx: &mut Context<Picker<Self>>,
|
||||||
|
) -> Option<gpui::AnyElement> {
|
||||||
|
Some(
|
||||||
|
h_flex()
|
||||||
|
.w_full()
|
||||||
|
.p_2()
|
||||||
|
.gap_2()
|
||||||
|
.border_t_1()
|
||||||
|
.border_color(cx.theme().colors().border_variant)
|
||||||
|
.child(
|
||||||
|
Button::new("docs", "Theme Docs").on_click(cx.listener(|_, _, _, cx| {
|
||||||
|
cx.open_url("https://zed.dev/docs/themes");
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
.child(div().flex_grow())
|
||||||
|
.child(
|
||||||
|
Button::new("more-themes", "Install Themes").on_click(cx.listener({
|
||||||
|
move |_, _, window, cx| {
|
||||||
|
window.dispatch_action(Box::new(Extensions), cx);
|
||||||
|
}
|
||||||
|
})),
|
||||||
|
)
|
||||||
|
.into_any_element(),
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue