feat: add adaptive app appearance
This commit is contained in:
@@ -100,6 +100,10 @@ mod tests {
|
||||
Preferences::default().icon_style,
|
||||
crate::domain::IconStyle::Outline
|
||||
);
|
||||
assert_eq!(
|
||||
Preferences::default().appearance,
|
||||
crate::domain::AppearanceMode::Auto
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::from_str::<Preferences>(r#"{"icon_style":"duotone"}"#)
|
||||
.unwrap()
|
||||
@@ -117,5 +121,22 @@ mod tests {
|
||||
Some(crate::domain::IconStyle::Bold)
|
||||
);
|
||||
assert_eq!(crate::domain::IconStyle::from_index(3), None);
|
||||
assert_eq!(
|
||||
serde_json::from_str::<Preferences>(r#"{"appearance":"dark"}"#)
|
||||
.unwrap()
|
||||
.appearance,
|
||||
crate::domain::AppearanceMode::Dark
|
||||
);
|
||||
assert_eq!(
|
||||
serde_json::from_str::<Preferences>(r#"{"appearance":"future-mode"}"#)
|
||||
.unwrap()
|
||||
.appearance,
|
||||
crate::domain::AppearanceMode::Auto
|
||||
);
|
||||
assert_eq!(
|
||||
crate::domain::AppearanceMode::from_index(1),
|
||||
Some(crate::domain::AppearanceMode::Light)
|
||||
);
|
||||
assert_eq!(crate::domain::AppearanceMode::from_index(3), None);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user