Add support for loading user themes (#7027)
This PR adds support for loading user themes in Zed. Themes are loaded from the `themes` directory under the Zed config: `~/.config/zed/themes`. This directory should contain JSON files containing a `ThemeFamilyContent`. Here's an example of the general structure of a theme family file: ```jsonc { "name": "Vitesse", "author": "Anthony Fu", "themes": [ { "name": "Vitesse Dark Soft", "appearance": "dark", "style": { "border": "#252525", // ... } } ] } ``` Themes placed in this directory will be loaded and available in the theme selector. Release Notes: - Added support for loading user themes from `~/.config/zed/themes`.
This commit is contained in:
parent
5f4dd36a1a
commit
9cb5a84b8d
9 changed files with 131 additions and 38 deletions
|
@ -2690,7 +2690,7 @@ mod tests {
|
|||
theme::init(theme::LoadThemes::JustBase, cx);
|
||||
|
||||
let mut has_default_theme = false;
|
||||
for theme_name in themes.list(false).map(|meta| meta.name) {
|
||||
for theme_name in themes.list(false).into_iter().map(|meta| meta.name) {
|
||||
let theme = themes.get(&theme_name).unwrap();
|
||||
assert_eq!(theme.name, theme_name);
|
||||
if theme.name == ThemeSettings::get(None, cx).active_theme.name {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue