mirror of
https://github.com/yattee/yattee.git
synced 2025-08-05 02:04:07 +00:00
Fix settings overlay layout
This commit is contained in:
@@ -140,7 +140,7 @@ struct ControlsOverlay: View {
|
||||
}
|
||||
#if os(macOS)
|
||||
.buttonStyle(.bordered)
|
||||
#else
|
||||
#elseif os(tvOS)
|
||||
.modifier(ControlBackgroundModifier())
|
||||
.clipShape(RoundedRectangle(cornerRadius: 4))
|
||||
#endif
|
||||
|
@@ -66,28 +66,40 @@ struct VideoPlayerView: View {
|
||||
|
||||
if playerControls.presentingControlsOverlay {
|
||||
HStack {
|
||||
ControlsOverlay()
|
||||
#if os(tvOS)
|
||||
.onExitCommand {
|
||||
withAnimation(PlayerControls.animation) {
|
||||
playerControls.hideOverlays()
|
||||
HStack {
|
||||
#if !os(tvOS)
|
||||
Spacer()
|
||||
#endif
|
||||
ControlsOverlay()
|
||||
#if os(tvOS)
|
||||
.onExitCommand {
|
||||
withAnimation(PlayerControls.animation) {
|
||||
playerControls.hideOverlays()
|
||||
}
|
||||
}
|
||||
}
|
||||
.onPlayPauseCommand {
|
||||
player.togglePlay()
|
||||
}
|
||||
#else
|
||||
.frame(maxWidth: overlayWidth)
|
||||
#endif
|
||||
.onPlayPauseCommand {
|
||||
player.togglePlay()
|
||||
}
|
||||
#endif
|
||||
.padding()
|
||||
.modifier(ControlBackgroundModifier())
|
||||
.clipShape(RoundedRectangle(cornerRadius: 4))
|
||||
.transition(.opacity)
|
||||
|
||||
#if !os(tvOS)
|
||||
Spacer()
|
||||
#endif
|
||||
}
|
||||
#if os(macOS)
|
||||
.frame(width: player.playerSize.width)
|
||||
#endif
|
||||
|
||||
#if !os(tvOS)
|
||||
Spacer()
|
||||
#endif
|
||||
}
|
||||
#if os(tvOS)
|
||||
.clipShape(RoundedRectangle(cornerRadius: 10))
|
||||
#else
|
||||
.frame(maxWidth: player.playerSize.width)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
@@ -105,9 +117,9 @@ struct VideoPlayerView: View {
|
||||
return GeometryReader { geometry in
|
||||
HSplitView {
|
||||
content
|
||||
.onAppear {
|
||||
playerSize = geometry.size
|
||||
}
|
||||
}
|
||||
.onAppear {
|
||||
playerSize = geometry.size
|
||||
}
|
||||
}
|
||||
.alert(isPresented: $navigation.presentingAlertInVideoPlayer) { navigation.alert }
|
||||
|
Reference in New Issue
Block a user