feat: Write built in themes to the themes file on first run so users can define custom themes

This commit is contained in:
2025-03-06 17:44:52 -07:00
parent 709f6ca6ca
commit df38ea5413
25 changed files with 758 additions and 74 deletions
@@ -2,34 +2,34 @@ use validate_theme_derive::ValidateTheme;
#[test]
fn test_validate_theme_derive() {
let theme = Theme {
name: "test".to_string(),
good: Some(Style {
color: "Green".to_owned(),
}),
bad: Some(Style {
color: "Red".to_owned(),
}),
ugly: Some(Style {
color: "Magenta".to_owned(),
}),
};
let theme = Theme {
name: "test".to_string(),
good: Some(Style {
color: "Green".to_owned(),
}),
bad: Some(Style {
color: "Red".to_owned(),
}),
ugly: Some(Style {
color: "Magenta".to_owned(),
}),
};
theme.validate();
theme.validate();
}
#[allow(dead_code)]
struct Style {
color: String,
color: String,
}
#[allow(dead_code)]
#[derive(ValidateTheme)]
struct Theme {
pub name: String,
#[validate]
pub good: Option<Style>,
#[validate]
pub bad: Option<Style>,
pub ugly: Option<Style>,
}
pub name: String,
#[validate]
pub good: Option<Style>,
#[validate]
pub bad: Option<Style>,
pub ugly: Option<Style>,
}