Remove checked-in theme JSON files
* Generate the themes on build * In debug builds, watch the theme sources. When they change, re-generate the themes and reload the current theme, removing the need for the `theme_selector::Reload` command. Co-authored-by: Keith Simmons <keith@zed.dev>
This commit is contained in:
parent
bdeac6b66a
commit
ec41dd9f18
15 changed files with 72 additions and 12288 deletions
|
@ -23,7 +23,6 @@ actions!(theme_selector, [Toggle, Reload]);
|
|||
|
||||
pub fn init(cx: &mut MutableAppContext) {
|
||||
cx.add_action(ThemeSelector::toggle);
|
||||
cx.add_action(ThemeSelector::reload);
|
||||
Picker::<ThemeSelector>::init(cx);
|
||||
}
|
||||
|
||||
|
@ -73,9 +72,9 @@ impl ThemeSelector {
|
|||
});
|
||||
}
|
||||
|
||||
fn reload(workspace: &mut Workspace, _: &Reload, cx: &mut ViewContext<Workspace>) {
|
||||
#[cfg(debug_assertions)]
|
||||
pub fn reload(themes: Arc<ThemeRegistry>, cx: &mut MutableAppContext) {
|
||||
let current_theme_name = cx.global::<Settings>().theme.name.clone();
|
||||
let themes = workspace.themes();
|
||||
themes.clear();
|
||||
match themes.get(¤t_theme_name) {
|
||||
Ok(theme) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue