Minor controls changes

This commit is contained in:
Arkadiusz Fal 2022-12-03 15:33:32 +01:00
parent 779bf190f4
commit 909f035399
3 changed files with 8 additions and 5 deletions

View File

@ -3,7 +3,7 @@ import Foundation
import SwiftUI
final class ControlOverlaysModel: ObservableObject {
static let animation = Animation.easeInOut(duration: 0.2)
static let animation = Animation.easeInOut(duration: 0.1)
static let shared = ControlOverlaysModel()
@Published private(set) var presenting = false { didSet { handlePresentationChange() } }

View File

@ -453,7 +453,7 @@ struct PlayerControls: View {
width _: Double? = nil,
height _: Double? = nil,
cornerRadius: Double = 3,
background: Bool = true,
background: Bool = false,
foregroundColor: Color? = nil,
active: Bool = false,
action: @escaping () -> Void = {}
@ -486,6 +486,7 @@ struct PlayerControls: View {
.frame(width: size ?? playerControlsLayout.buttonSize, height: size ?? playerControlsLayout.buttonSize)
.modifier(ControlBackgroundModifier(enabled: useBackground))
.clipShape(RoundedRectangle(cornerRadius: cornerRadius))
.environment(\.colorScheme, .dark)
}
}

View File

@ -124,7 +124,7 @@ struct TimelineView: View {
.frame(minWidth: 35)
.padding(.leading, playerControlsLayout.timeLeadingEdgePadding)
.padding(.trailing, playerControlsLayout.timeTrailingEdgePadding)
.modifier(ControlBackgroundModifier())
.shadow(radius: 3)
.clipShape(RoundedRectangle(cornerRadius: 4))
ZStack {
@ -171,10 +171,10 @@ struct TimelineView: View {
#endif
durationView
.shadow(radius: 3)
.padding(.leading, playerControlsLayout.timeTrailingEdgePadding)
.padding(.trailing, playerControlsLayout.timeLeadingEdgePadding)
.frame(minWidth: 30, alignment: .trailing)
.modifier(ControlBackgroundModifier())
.clipShape(RoundedRectangle(cornerRadius: 4))
}
#if !os(tvOS)
@ -213,6 +213,7 @@ struct TimelineView: View {
#endif
.font(.system(size: playerControlsLayout.timeFontSize).monospacedDigit())
.zIndex(2)
.foregroundColor(.white)
}
}
@ -319,7 +320,7 @@ struct TimelineView: View {
ForEach(chapters) { chapter in
RoundedRectangle(cornerRadius: 4)
.fill(Color.orange)
.frame(maxWidth: 2, maxHeight: 12)
.frame(maxWidth: 2, maxHeight: height)
.offset(x: (chapter.start * oneUnitWidth) - 1)
}
}
@ -376,6 +377,7 @@ struct TimelineView_Previews: PreviewProvider {
return VStack(spacing: 40) {
TimelineView()
}
.background(Color.black)
.padding()
}
}