Generalize Refineable derive macro to derive arbitrary traits on the refinement type

This commit is contained in:
Max Brunsfeld
2023-11-09 13:23:31 -08:00
parent dba41e99dd
commit 28d3d21108
6 changed files with 24 additions and 40 deletions
+2 -2
View File
@@ -14,7 +14,7 @@ pub struct SystemColors {
}
#[derive(Refineable, Clone, Debug)]
#[refineable(debug)]
#[refineable(Debug)]
pub struct StatusColors {
pub conflict: Hsla,
pub created: Hsla,
@@ -30,7 +30,7 @@ pub struct StatusColors {
}
#[derive(Refineable, Clone, Debug)]
#[refineable(debug, deserialize)]
#[refineable(Debug, serde::Deserialize)]
pub struct ThemeColors {
pub border: Hsla,
/// Border color. Used for deemphasized borders, like a visual divider between two sections
+2 -3
View File
@@ -1,8 +1,7 @@
use crate::{Appearance, ThemeColors, ThemeColorsRefinement};
use refineable::Refineable;
use serde::Deserialize;
use crate::{Appearance, ThemeColors, ThemeColorsRefinement};
#[derive(Deserialize)]
pub struct UserThemeFamily {
pub name: String,
@@ -18,7 +17,7 @@ pub struct UserTheme {
}
#[derive(Refineable, Clone)]
#[refineable(deserialize)]
#[refineable(Deserialize)]
pub struct UserThemeStyles {
#[refineable]
pub colors: ThemeColors,