style: fade playlist chrome into queue background

This commit is contained in:
2026-10-18 21:07:00 +02:00
parent b8275635f0
commit 0084609a00
2 changed files with 28 additions and 1 deletions
+26 -1
View File
@@ -2284,6 +2284,27 @@ private struct PlayerContent: View {
)
}
private var queueBackground: Color { Color(nsColor: .textBackgroundColor) }
private func queueChromeBackground(top: Bool) -> some View {
VStack(spacing: 0) {
if !top {
LinearGradient(colors: [queueBackground.opacity(0), queueBackground],
startPoint: .top, endPoint: .bottom)
.frame(height: 20)
}
queueBackground
if top {
LinearGradient(colors: [queueBackground, queueBackground.opacity(0)],
startPoint: .top, endPoint: .bottom)
.frame(height: 20)
}
}
.padding(top ? .bottom : .top, -20)
.allowsHitTesting(false)
.accessibilityHidden(true)
}
private var queueSidebar: some View {
VStack(spacing: 0) {
Color.clear.frame(height: 32)
@@ -2351,6 +2372,7 @@ private struct PlayerContent: View {
.onMove { model.moveQueueItems(fromOffsets: $0, toOffset: $1) }
}
.listStyle(.plain)
.scrollContentBackground(.hidden)
.contentMargins(.horizontal, 0, for: .scrollContent)
.overlay {
if model.queue.items.isEmpty {
@@ -2389,13 +2411,16 @@ private struct PlayerContent: View {
}
.padding(.horizontal, 12)
.padding(.vertical, 8)
.background { queueChromeBackground(top: false) }
}
.frame(width: 260)
.background(PlayerGlass(cornerRadius: 0))
.background(queueBackground)
.overlay(alignment: .topTrailing) {
titleControls
.padding(.trailing, 4)
.frame(height: 32)
.frame(maxWidth: .infinity, alignment: .trailing)
.background { queueChromeBackground(top: true) }
}
.dropDestination(for: URL.self) { urls, _ in
guard model.canOpen, urls.contains(where: \.isFileURL) else { return false }