mirror of
https://github.com/yattee/yattee.git
synced 2024-11-09 15:58:20 +00:00
Minor controls changes
This commit is contained in:
parent
779bf190f4
commit
909f035399
@ -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() } }
|
||||
|
||||
|
@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user