Remove old Theme definition (#3195)
This PR removes the old `Theme` definition in favor of the new `ThemeVariant`s. The new `SyntaxStyles` have been reverted to the old `SyntaxTheme` that operates by storing the syntax styles as a vector of `gpui2::HighlightStyle`s. This is necessary for the intended usage by `language2`, where we find the longest key in the theme's syntax styles that matches the capture name: https://github.com/zed-industries/zed/blob/18431051d9d750d9e66284a71f7a55a1e31c1374/crates/language2/src/highlight_map.rs#L15-L41
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
use crate::{
|
||||
colors::{GitStatusColors, PlayerColors, StatusColors, SystemColors, ThemeColors, ThemeStyle},
|
||||
default_color_scales, Appearance, SyntaxStyles, ThemeFamily, ThemeVariant,
|
||||
default_color_scales, Appearance, SyntaxTheme, ThemeFamily, ThemeVariant,
|
||||
};
|
||||
|
||||
fn zed_pro_daylight() -> ThemeVariant {
|
||||
ThemeVariant {
|
||||
id: "zed_pro_daylight".to_string(),
|
||||
name: "Zed Pro Daylight".to_string(),
|
||||
name: "Zed Pro Daylight".into(),
|
||||
appearance: Appearance::Light,
|
||||
styles: ThemeStyle {
|
||||
system: SystemColors::default(),
|
||||
@@ -14,7 +14,7 @@ fn zed_pro_daylight() -> ThemeVariant {
|
||||
status: StatusColors::default(),
|
||||
git: GitStatusColors::default(),
|
||||
player: PlayerColors::default(),
|
||||
syntax: SyntaxStyles::default_light(),
|
||||
syntax: SyntaxTheme::default_light(),
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -22,15 +22,15 @@ fn zed_pro_daylight() -> ThemeVariant {
|
||||
pub(crate) fn zed_pro_moonlight() -> ThemeVariant {
|
||||
ThemeVariant {
|
||||
id: "zed_pro_moonlight".to_string(),
|
||||
name: "Zed Pro Moonlight".to_string(),
|
||||
appearance: Appearance::Light,
|
||||
name: "Zed Pro Moonlight".into(),
|
||||
appearance: Appearance::Dark,
|
||||
styles: ThemeStyle {
|
||||
system: SystemColors::default(),
|
||||
colors: ThemeColors::default_dark(),
|
||||
status: StatusColors::default(),
|
||||
git: GitStatusColors::default(),
|
||||
player: PlayerColors::default(),
|
||||
syntax: SyntaxStyles::default_dark(),
|
||||
syntax: SyntaxTheme::default_dark(),
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -38,8 +38,8 @@ pub(crate) fn zed_pro_moonlight() -> ThemeVariant {
|
||||
pub fn zed_pro_family() -> ThemeFamily {
|
||||
ThemeFamily {
|
||||
id: "zed_pro".to_string(),
|
||||
name: "Zed Pro".to_string(),
|
||||
author: "Zed Team".to_string(),
|
||||
name: "Zed Pro".into(),
|
||||
author: "Zed Team".into(),
|
||||
themes: vec![zed_pro_daylight(), zed_pro_moonlight()],
|
||||
scales: default_color_scales(),
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user