Album art theme on web and iOS, roomier player bar
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
0c9cae5b11
commit
8e57b9d0cd
8 files changed
+116
-10
No files matched your search
@@ -6,11 +6,13 @@ import UIKit
|
||||
/// (or the stems, queue and lyrics deck) on the other, and the tabs stay in the system's own bar.
|
||||
struct RootView: View {
|
||||
@State private var ui = Ui(overlays: Overlays())
|
||||
@State private var art: ArtHue?
|
||||
private var g: AppGraph { .shared }
|
||||
|
||||
var body: some View {
|
||||
let s = g.settings
|
||||
let p = Palette.of(s.theme, s.accent)
|
||||
let base = Palette.of(s.theme, s.accent)
|
||||
let p = s.albumTheme ? art.map { base.art($0, mode: s.theme) } ?? base : base
|
||||
bar
|
||||
.modifier(GlassMiniPlayerHost())
|
||||
// Folded on the Duo the app stays upright (the window's trailing inset gives the Duo away).
|
||||
@@ -33,6 +35,11 @@ struct RootView: View {
|
||||
.environment(\.palette, p)
|
||||
.preferredColorScheme(s.theme == .White ? .light : .dark)
|
||||
.tint(p.accent)
|
||||
.task(id: "\(g.playback.current?.track.thumb ?? "")|\(s.albumTheme)") {
|
||||
guard s.albumTheme, let thumb = g.playback.current?.track.thumb else { art = nil; return }
|
||||
let a = await artHue(thumb)
|
||||
withAnimation(.easeInOut(duration: 0.4)) { art = a }
|
||||
}
|
||||
}
|
||||
|
||||
@Environment(\.verticalSizeClass) private var vSize
|
||||
|
||||
Reference in new issue
Block a user