ui: outline welcome actions and animate URL input toggle

This commit is contained in:
2026-10-12 14:59:14 +02:00
parent e3e6a66216
commit aacd260fe7
2 changed files with 20 additions and 5 deletions
+19 -4
View File
@@ -1265,6 +1265,14 @@ private struct PlayerContent: View {
@State private var controlOffset = CGSize.zero
@State private var dragOrigin = CGSize.zero
private func toggleYouTubeInput() {
if showsYouTubeInput { youTubeInputFocused = false }
withAnimation(reduceMotion ? nil : .easeInOut(duration: 0.22)) {
showsYouTubeInput.toggle()
}
if showsYouTubeInput { youTubeInputFocused = true }
}
private var showsBufferReadout: Bool { model.isNetworkMedia && model.showsBufferInfo }
private var controlHeight: CGFloat { showsBufferReadout ? 88 : 68 }
private var compactControlHeight: CGFloat { showsBufferReadout ? 52 : 40 }
@@ -1551,16 +1559,19 @@ private struct PlayerContent: View {
.contentShape(Rectangle())
}
.background(Color(SunsetPalette.actionFill), in: RoundedRectangle(cornerRadius: 8))
Button {
showsYouTubeInput = true
youTubeInputFocused = true
} label: {
.overlay(RoundedRectangle(cornerRadius: 8)
.strokeBorder(Color(SunsetPalette.outline), lineWidth: 0.5)
.allowsHitTesting(false))
Button(action: toggleYouTubeInput) {
Label("YouTube URL…", systemImage: "link")
.frame(maxWidth: .infinity, minHeight: 40)
.contentShape(Rectangle())
}
.accessibilityLabel("Open YouTube URL…")
.background(Color(SunsetPalette.actionFill), in: RoundedRectangle(cornerRadius: 8))
.overlay(RoundedRectangle(cornerRadius: 8)
.strokeBorder(Color(SunsetPalette.outline), lineWidth: 0.5)
.allowsHitTesting(false))
}
.font(.system(size: 13, weight: .medium))
.foregroundStyle(Color(SunsetPalette.text))
@@ -1592,6 +1603,10 @@ private struct PlayerContent: View {
.padding(.horizontal, 12)
.frame(height: 40)
.background(Color(SunsetPalette.actionFill), in: RoundedRectangle(cornerRadius: 8))
.overlay(RoundedRectangle(cornerRadius: 8)
.strokeBorder(Color(SunsetPalette.outline), lineWidth: 0.5)
.allowsHitTesting(false))
.transition(reduceMotion ? .opacity : .move(edge: .top).combined(with: .opacity))
.disabled(!model.canOpen)
}
Text("Drop a media file or YouTube link here")