Checkpoint Broken

This commit is contained in:
Nate Butler
2023-11-13 12:44:50 -05:00
parent 5361a499ae
commit 7be12cb7b1
7 changed files with 99 additions and 45 deletions
+45 -1
View File
@@ -1,4 +1,29 @@
use crate::StatusColors;
use gpui::Hsla;
use crate::{blue, grass, neutral, red, yellow, StatusColors};
impl Default for StatusColors {
/// Don't use this!
/// We have to have a default for StatusColors to be `[refineable::Refinable]`.
fn default() -> Self {
Self::dark()
}
}
pub struct DiagnosticColors {
pub error: Hsla,
pub warning: Hsla,
pub info: Hsla,
}
pub struct GitStatusColors {
pub created: Hsla,
pub deleted: Hsla,
pub modified: Hsla,
pub renamed: Hsla,
pub conflict: Hsla,
pub ignored: Hsla,
}
impl StatusColors {
pub fn dark() -> Self {
@@ -38,4 +63,23 @@ impl StatusColors {
warning: yellow().light().step_9(),
}
}
pub fn diagnostic(&self) -> DiagnosticColors {
DiagnosticColors {
error: self.error,
warning: self.warning,
info: self.info,
}
}
pub fn git(&self) -> GitStatusColors {
GitStatusColors {
created: self.created,
deleted: self.deleted,
modified: self.modified,
renamed: self.renamed,
conflict: self.conflict,
ignored: self.ignored,
}
}
}