aboutsummaryrefslogtreecommitdiff
path: root/ui/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'ui/src/lib.rs')
-rw-r--r--ui/src/lib.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/ui/src/lib.rs b/ui/src/lib.rs
index f32657d..d74df51 100644
--- a/ui/src/lib.rs
+++ b/ui/src/lib.rs
@@ -35,14 +35,20 @@ pub struct RenderInfo<'a> {
}
pub fn render_view(ri: RenderInfo<'_>, view: Object<'_>) -> String {
+ let theme = ri
+ .user
+ .and_then(|u| u.get(USER_THEME_PRESET))
+ .unwrap_or(THEME_DARK);
Scaffold {
ri: &ri,
main: View { ri: &ri, view },
title: view.get(VIEW_TITLE).unwrap_or_default(),
- class: if view.has(VIEW_PLAYER.0) {
- "theme-purple player"
- } else {
- "theme-purple"
+ class: match (theme, view.has(VIEW_PLAYER.0)) {
+ (THEME_DARK, true) => "theme-dark player",
+ (THEME_DARK, false) => "theme-dark",
+ (THEME_LIGHT, true) => "theme-light player",
+ (THEME_LIGHT, false) => "theme-light",
+ _ => "theme-dark",
},
}
.to_string()