feat: add adaptive app appearance

This commit is contained in:
Georg Bauer
2026-07-30 18:28:47 +02:00
parent d8a63c00f5
commit 1e3241bf65
4 changed files with 232 additions and 102 deletions

View File

@@ -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);
}
}