fix top compact overlay gradient
This commit is contained in:
parent
dde0852425
commit
ae959dde6c
|
@ -14,7 +14,6 @@ import Sliders
|
||||||
import SwiftUI
|
import SwiftUI
|
||||||
|
|
||||||
struct VLCPlayerOverlayView: View {
|
struct VLCPlayerOverlayView: View {
|
||||||
|
|
||||||
@ObservedObject
|
@ObservedObject
|
||||||
var viewModel: VideoPlayerViewModel
|
var viewModel: VideoPlayerViewModel
|
||||||
|
|
||||||
|
@ -49,11 +48,9 @@ struct VLCPlayerOverlayView: View {
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private var mainBody: some View {
|
private var mainBody: some View {
|
||||||
VStack {
|
VStack {
|
||||||
|
|
||||||
// MARK: Top Bar
|
// MARK: Top Bar
|
||||||
|
|
||||||
ZStack(alignment: .center) {
|
ZStack(alignment: .top) {
|
||||||
|
|
||||||
if viewModel.overlayType == .compact {
|
if viewModel.overlayType == .compact {
|
||||||
LinearGradient(gradient: Gradient(colors: [.black.opacity(0.8), .clear]),
|
LinearGradient(gradient: Gradient(colors: [.black.opacity(0.8), .clear]),
|
||||||
startPoint: .top,
|
startPoint: .top,
|
||||||
|
@ -63,9 +60,7 @@ struct VLCPlayerOverlayView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
VStack(alignment: .EpisodeSeriesAlignmentGuide) {
|
VStack(alignment: .EpisodeSeriesAlignmentGuide) {
|
||||||
|
|
||||||
HStack(alignment: .center) {
|
HStack(alignment: .center) {
|
||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
Button {
|
Button {
|
||||||
viewModel.playerOverlayDelegate?.didSelectClose()
|
viewModel.playerOverlayDelegate?.didSelectClose()
|
||||||
|
@ -87,7 +82,6 @@ struct VLCPlayerOverlayView: View {
|
||||||
Spacer()
|
Spacer()
|
||||||
|
|
||||||
HStack(spacing: 20) {
|
HStack(spacing: 20) {
|
||||||
|
|
||||||
// MARK: Previous Item
|
// MARK: Previous Item
|
||||||
|
|
||||||
if viewModel.shouldShowPlayPreviousItem {
|
if viewModel.shouldShowPlayPreviousItem {
|
||||||
|
@ -165,7 +159,6 @@ struct VLCPlayerOverlayView: View {
|
||||||
// MARK: Settings Menu
|
// MARK: Settings Menu
|
||||||
|
|
||||||
Menu {
|
Menu {
|
||||||
|
|
||||||
// MARK: Audio Streams
|
// MARK: Audio Streams
|
||||||
|
|
||||||
Menu {
|
Menu {
|
||||||
|
@ -337,7 +330,6 @@ struct VLCPlayerOverlayView: View {
|
||||||
// MARK: Bottom Bar
|
// MARK: Bottom Bar
|
||||||
|
|
||||||
ZStack(alignment: .center) {
|
ZStack(alignment: .center) {
|
||||||
|
|
||||||
if viewModel.overlayType == .compact {
|
if viewModel.overlayType == .compact {
|
||||||
LinearGradient(gradient: Gradient(colors: [.clear, .black.opacity(0.8)]),
|
LinearGradient(gradient: Gradient(colors: [.clear, .black.opacity(0.8)]),
|
||||||
startPoint: .top,
|
startPoint: .top,
|
||||||
|
@ -347,7 +339,6 @@ struct VLCPlayerOverlayView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
|
|
||||||
if viewModel.overlayType == .compact {
|
if viewModel.overlayType == .compact {
|
||||||
HStack {
|
HStack {
|
||||||
Button {
|
Button {
|
||||||
|
@ -431,7 +422,6 @@ struct VLCPlayerOverlayView: View {
|
||||||
}
|
}
|
||||||
|
|
||||||
struct VLCPlayerCompactOverlayView_Previews: PreviewProvider {
|
struct VLCPlayerCompactOverlayView_Previews: PreviewProvider {
|
||||||
|
|
||||||
static let videoPlayerViewModel = VideoPlayerViewModel(item: BaseItemDto(),
|
static let videoPlayerViewModel = VideoPlayerViewModel(item: BaseItemDto(),
|
||||||
title: "Glorious Purpose",
|
title: "Glorious Purpose",
|
||||||
subtitle: "Loki - S1E1",
|
subtitle: "Loki - S1E1",
|
||||||
|
@ -469,7 +459,6 @@ struct VLCPlayerCompactOverlayView_Previews: PreviewProvider {
|
||||||
// MARK: TitleSubtitleAlignment
|
// MARK: TitleSubtitleAlignment
|
||||||
|
|
||||||
extension HorizontalAlignment {
|
extension HorizontalAlignment {
|
||||||
|
|
||||||
private struct TitleSubtitleAlignment: AlignmentID {
|
private struct TitleSubtitleAlignment: AlignmentID {
|
||||||
static func defaultValue(in context: ViewDimensions) -> CGFloat {
|
static func defaultValue(in context: ViewDimensions) -> CGFloat {
|
||||||
context[HorizontalAlignment.leading]
|
context[HorizontalAlignment.leading]
|
||||||
|
|
Loading…
Reference in New Issue