Skip to content

Commit

Permalink
🚨 fix missing surface color default (#200)
Browse files Browse the repository at this point in the history
  • Loading branch information
friedow authored Oct 15, 2024
1 parent 60481e9 commit 56697f1
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions client/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,39 @@ pub struct GitRepositoriesPluginSettings {
pub commands: Vec<Vec<String>>,
}

fn default_white() -> String {
"#ffffff".into()
}

fn default_black() -> String {
"#000000".into()
}

fn default_deprecated() -> String {
"deprecated".into()
}

#[derive(Debug, Deserialize)]
pub struct ColorSettings {
#[serde(default = "default_white")]
pub text: String,
#[serde(default = "default_black")]
pub background: String,
#[deprecated(
since = "1.2.0",
note = "color.surface has been replaced by automatic shading of the background color. Please remove this field from your configuration."
)]
#[serde(default = "default_deprecated")]
pub surface: String,
}

impl Default for ColorSettings {
fn default() -> Self {
#[allow(deprecated)]
Self {
text: "#ffffff".to_string(),
background: "#000000".to_string(),
surface: "deprecated".to_string(),
text: default_white(),
background: default_black(),
surface: default_deprecated(),
}
}
}
Expand Down

0 comments on commit 56697f1

Please sign in to comment.