fix: anchor title controls outside the animated queue clip

This commit is contained in:
2026-10-18 22:08:41 +02:00
parent 22f13dd08d
commit 2e5255e194
4 changed files with 27 additions and 16 deletions
+22 -14
View File
@@ -2142,12 +2142,9 @@ private struct PlayerContent: View {
.frame(height: 24)
.background(PlayerGlass(cornerRadius: 8).clipShape(RoundedRectangle(cornerRadius: 8)).allowsHitTesting(false))
Spacer(minLength: 12)
if !model.showsQueue {
titleControls
}
}
.padding(.leading, model.isFullScreen ? 16 : 86)
.padding(.trailing, 4)
.padding(.trailing, 92 - 88 * model.queueWidth / 260)
.frame(height: 32)
.foregroundStyle(Color(SunsetPalette.text))
.onHover(perform: model.setTitleHovered)
@@ -2168,13 +2165,13 @@ private struct PlayerContent: View {
CastDeviceMenu(model: model)
actionsMenu
}
.padding(.horizontal, model.showsQueue ? 0 : 4)
.padding(.horizontal, 4 * (1 - model.queueWidth / 260))
.frame(height: 24)
.background {
if !model.showsQueue {
PlayerGlass(cornerRadius: 8)
.clipShape(RoundedRectangle(cornerRadius: 8)).allowsHitTesting(false)
}
PlayerGlass(cornerRadius: 8)
.clipShape(RoundedRectangle(cornerRadius: 8))
.opacity(1 - model.queueWidth / 260)
.allowsHitTesting(false)
}
}
@@ -2485,12 +2482,9 @@ private struct PlayerContent: View {
}
.frame(width: 260)
.background(queueBackground)
.overlay(alignment: .topTrailing) {
titleControls
.padding(.trailing, 4)
.overlay(alignment: .top) {
queueChromeBackground(top: true)
.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 }
@@ -2501,6 +2495,7 @@ private struct PlayerContent: View {
}
var body: some View {
let titleControlsVisible = model.showsQueue || model.isQueueTransitioning || model.controlsVisible
HStack(spacing: 0) {
videoContent
if !model.isCompact && !model.compactWindow.isTransitioning && model.queueWidth > 0 {
@@ -2513,6 +2508,19 @@ private struct PlayerContent: View {
}
.frame(minWidth: model.isCompact || model.compactWindow.isTransitioning ? 160 : 400 + model.queueWidth,
minHeight: model.isCompact || model.compactWindow.isTransitioning ? model.compactContentMinimumHeight : 240)
.overlay(alignment: .topTrailing) {
if !model.isCompact && !model.compactWindow.isTransitioning {
titleControls
.padding(.trailing, 4)
.frame(height: 32)
.onHover(perform: model.setTitleHovered)
.animation(model.isQueueTransitioning ? nil : controlsVisibilityAnimation) { content in
content.opacity(titleControlsVisible ? 1 : 0)
}
.allowsHitTesting(titleControlsVisible)
.accessibilityHidden(!titleControlsVisible)
}
}
.ignoresSafeArea()
.preferredColorScheme(.dark)
.foregroundStyle(Color(SunsetPalette.text))