mirror of
https://github.com/yattee/yattee.git
synced 2025-08-09 20:24:06 +00:00
tvOS layout improvements
This commit is contained in:
@@ -33,7 +33,6 @@ struct PlayerBackendView: View {
|
||||
.onAppear { player.playerSize = proxy.size }
|
||||
.onChange(of: proxy.size) { _ in player.playerSize = proxy.size }
|
||||
.onChange(of: player.controls.presentingOverlays) { _ in player.playerSize = proxy.size }
|
||||
.onChange(of: player.aspectRatio) { _ in player.playerSize = proxy.size }
|
||||
})
|
||||
#if os(iOS)
|
||||
.padding(.top, player.playingFullScreen && verticalSizeClass == .regular ? 20 : 0)
|
||||
@@ -46,6 +45,8 @@ struct PlayerBackendView: View {
|
||||
.padding(.top, controlsTopPadding)
|
||||
.padding(.bottom, controlsBottomPadding)
|
||||
#endif
|
||||
#else
|
||||
hiddenControlsButton
|
||||
#endif
|
||||
}
|
||||
#if os(iOS)
|
||||
@@ -82,6 +83,22 @@ struct PlayerBackendView: View {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#if os(tvOS)
|
||||
private var hiddenControlsButton: some View {
|
||||
VStack {
|
||||
Button {
|
||||
player.controls.show()
|
||||
} label: {
|
||||
EmptyView()
|
||||
}
|
||||
.offset(y: -100)
|
||||
.buttonStyle(.plain)
|
||||
.background(Color.clear)
|
||||
.foregroundColor(.clear)
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
struct PlayerBackendView_Previews: PreviewProvider {
|
||||
|
Reference in New Issue
Block a user