diff --git a/crates/theme/src/schema.rs b/crates/theme/src/schema.rs index 54bc12e5909833bdbef87eb8f8241ae272417f19..945517daea904e3bb5bdfe4954813a81af2a9e2b 100644 --- a/crates/theme/src/schema.rs +++ b/crates/theme/src/schema.rs @@ -1,12 +1,12 @@ #![allow(missing_docs)] -use gpui::{FontStyle, FontWeight, HighlightStyle, Hsla, WindowBackgroundAppearance}; +use gpui::{FontStyle, FontWeight, HighlightStyle, Hsla}; use indexmap::IndexMap; use palette::FromColor; -use schemars::{JsonSchema, JsonSchema_repr}; +use schemars::JsonSchema; use serde::{Deserialize, Serialize}; -use serde_repr::{Deserialize_repr, Serialize_repr}; use settings::{AccentContent, PlayerColorContent}; +pub use settings::{FontWeightContent, WindowBackgroundContent}; use crate::{StatusColorsRefinement, ThemeColorsRefinement}; @@ -33,25 +33,6 @@ pub enum AppearanceContent { Dark, } -/// The background appearance of the window. -#[derive(Debug, PartialEq, Clone, Copy, Serialize, Deserialize, JsonSchema)] -#[serde(rename_all = "snake_case")] -pub enum WindowBackgroundContent { - Opaque, - Transparent, - Blurred, -} - -impl From for WindowBackgroundAppearance { - fn from(value: WindowBackgroundContent) -> Self { - match value { - WindowBackgroundContent::Opaque => WindowBackgroundAppearance::Opaque, - WindowBackgroundContent::Transparent => WindowBackgroundAppearance::Transparent, - WindowBackgroundContent::Blurred => WindowBackgroundAppearance::Blurred, - } - } -} - /// The content of a serialized theme family. #[derive(Debug, Clone, Serialize, Deserialize, JsonSchema)] pub struct ThemeFamilyContent { @@ -73,7 +54,7 @@ pub struct ThemeContent { #[serde(default)] pub struct ThemeStyleContent { #[serde(default, rename = "background.appearance")] - pub window_background_appearance: Option, + pub window_background_appearance: Option, #[serde(default)] pub accents: Vec, @@ -290,20 +271,6 @@ pub fn status_colors_refinement(colors: &settings::StatusColorsContent) -> Statu } } -#[derive(Debug, Clone, Copy, Serialize_repr, Deserialize_repr, JsonSchema_repr, PartialEq)] -#[repr(u16)] -pub enum FontWeightContent { - Thin = 100, - ExtraLight = 200, - Light = 300, - Normal = 400, - Medium = 500, - Semibold = 600, - Bold = 700, - ExtraBold = 800, - Black = 900, -} - pub fn theme_colors_refinement( this: &settings::ThemeColorsContent, status_colors: &StatusColorsRefinement, diff --git a/crates/theme_importer/src/vscode/converter.rs b/crates/theme_importer/src/vscode/converter.rs index b3b846d91d5ac3a7e3d88983787d23fe9f0adece..b0fd312fff7cb45ed80743187ca313e3957b3fba 100644 --- a/crates/theme_importer/src/vscode/converter.rs +++ b/crates/theme_importer/src/vscode/converter.rs @@ -3,7 +3,7 @@ use indexmap::IndexMap; use strum::IntoEnumIterator; use theme::{ FontStyleContent, FontWeightContent, HighlightStyleContent, StatusColorsContent, - ThemeColorsContent, ThemeContent, ThemeStyleContent, + ThemeColorsContent, ThemeContent, ThemeStyleContent, WindowBackgroundContent, }; use crate::ThemeMetadata; @@ -56,7 +56,7 @@ impl VsCodeThemeConverter { name: self.theme_metadata.name, appearance, style: ThemeStyleContent { - window_background_appearance: Some(theme::WindowBackgroundContent::Opaque), + window_background_appearance: Some(WindowBackgroundContent::Opaque), accents: Vec::new(), //TODO can we read this from the theme? colors: theme_colors, status: status_colors,