This PR enables required documentation for the `theme` crate starts on documenting it. The end goal is to have all meaningful documentation in the crate filled out – However I'm not sure that just adding `#![deny(missing_docs)]` to the whole crate is the right approach. I don't know that having 200+ "The color of the _ color" field docs is useful however–In the short term I've excluded some of the modules that contain structs with a ton of fields (`colors, `status`, etc.) until we decide what the right solution here is. Next steps are to clean up the crate, removing unused modules or those with low usage in favor of other approaches. Changes in this PR: - Enable the `deny(missing_docs)` lint for the `theme` crate - Start documenting a subset of the crate. - Enable `#![allow(missing_docs)]` for some modules. Release Notes: - N/A
72 lines
1.9 KiB
Rust
72 lines
1.9 KiB
Rust
use std::sync::Arc;
|
|
|
|
use gpui::WindowBackgroundAppearance;
|
|
|
|
use crate::AccentColors;
|
|
|
|
use crate::{
|
|
default_color_scales,
|
|
one_themes::{one_dark, one_family},
|
|
Appearance, PlayerColors, StatusColors, SyntaxTheme, SystemColors, Theme, ThemeColors,
|
|
ThemeFamily, ThemeStyles,
|
|
};
|
|
|
|
fn zed_pro_daylight() -> Theme {
|
|
Theme {
|
|
id: "zed_pro_daylight".to_string(),
|
|
name: "Zed Pro Daylight".into(),
|
|
appearance: Appearance::Light,
|
|
styles: ThemeStyles {
|
|
window_background_appearance: WindowBackgroundAppearance::Opaque,
|
|
system: SystemColors::default(),
|
|
colors: ThemeColors::light(),
|
|
status: StatusColors::light(),
|
|
player: PlayerColors::light(),
|
|
syntax: Arc::new(SyntaxTheme::default()),
|
|
accents: AccentColors::light(),
|
|
},
|
|
}
|
|
}
|
|
|
|
pub(crate) fn zed_pro_moonlight() -> Theme {
|
|
Theme {
|
|
id: "zed_pro_moonlight".to_string(),
|
|
name: "Zed Pro Moonlight".into(),
|
|
appearance: Appearance::Dark,
|
|
styles: ThemeStyles {
|
|
window_background_appearance: WindowBackgroundAppearance::Opaque,
|
|
system: SystemColors::default(),
|
|
colors: ThemeColors::dark(),
|
|
status: StatusColors::dark(),
|
|
player: PlayerColors::dark(),
|
|
syntax: Arc::new(SyntaxTheme::default()),
|
|
accents: AccentColors::dark(),
|
|
},
|
|
}
|
|
}
|
|
|
|
/// Returns the Zed Pro theme family.
|
|
///
|
|
/// Note: To be removed until the theme is implemented.
|
|
pub fn zed_pro_family() -> ThemeFamily {
|
|
ThemeFamily {
|
|
id: "zed_pro".to_string(),
|
|
name: "Zed Pro".into(),
|
|
author: "Zed Team".into(),
|
|
themes: vec![zed_pro_daylight(), zed_pro_moonlight()],
|
|
scales: default_color_scales(),
|
|
}
|
|
}
|
|
|
|
impl Default for ThemeFamily {
|
|
fn default() -> Self {
|
|
one_family()
|
|
}
|
|
}
|
|
|
|
impl Default for Theme {
|
|
fn default() -> Self {
|
|
one_dark()
|
|
}
|
|
}
|