default_theme.rs

 1use std::sync::Arc;
 2
 3use gpui::WindowBackgroundAppearance;
 4
 5use crate::AccentColors;
 6
 7use crate::{
 8    default_color_scales,
 9    one_themes::{one_dark, one_family},
10    Appearance, PlayerColors, StatusColors, SyntaxTheme, SystemColors, Theme, ThemeColors,
11    ThemeFamily, ThemeStyles,
12};
13
14fn zed_pro_daylight() -> Theme {
15    Theme {
16        id: "zed_pro_daylight".to_string(),
17        name: "Zed Pro Daylight".into(),
18        appearance: Appearance::Light,
19        styles: ThemeStyles {
20            window_background_appearance: WindowBackgroundAppearance::Opaque,
21            system: SystemColors::default(),
22            colors: ThemeColors::light(),
23            status: StatusColors::light(),
24            player: PlayerColors::light(),
25            syntax: Arc::new(SyntaxTheme::default()),
26            accents: AccentColors::light(),
27        },
28    }
29}
30
31pub(crate) fn zed_pro_moonlight() -> Theme {
32    Theme {
33        id: "zed_pro_moonlight".to_string(),
34        name: "Zed Pro Moonlight".into(),
35        appearance: Appearance::Dark,
36        styles: ThemeStyles {
37            window_background_appearance: WindowBackgroundAppearance::Opaque,
38            system: SystemColors::default(),
39            colors: ThemeColors::dark(),
40            status: StatusColors::dark(),
41            player: PlayerColors::dark(),
42            syntax: Arc::new(SyntaxTheme::default()),
43            accents: AccentColors::dark(),
44        },
45    }
46}
47
48/// Returns the Zed Pro theme family.
49///
50/// Note: To be removed until the theme is implemented.
51pub fn zed_pro_family() -> ThemeFamily {
52    ThemeFamily {
53        id: "zed_pro".to_string(),
54        name: "Zed Pro".into(),
55        author: "Zed Team".into(),
56        themes: vec![zed_pro_daylight(), zed_pro_moonlight()],
57        scales: default_color_scales(),
58    }
59}
60
61impl Default for ThemeFamily {
62    fn default() -> Self {
63        one_family()
64    }
65}
66
67impl Default for Theme {
68    fn default() -> Self {
69        one_dark()
70    }
71}