mirror of
https://github.com/yattee/yattee.git
synced 2024-12-22 13:33:42 +00:00
Fix settings overlay layout
This commit is contained in:
parent
62769016fc
commit
356f8c7af1
@ -51,7 +51,7 @@ struct FixtureEnvironmentObjectsModifier: ViewModifier {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private var playerControls: PlayerControlsModel {
|
private var playerControls: PlayerControlsModel {
|
||||||
PlayerControlsModel(presentingControls: true, presentingControlsOverlay: false, player: player)
|
PlayerControlsModel(presentingControls: false, presentingControlsOverlay: true, player: player)
|
||||||
}
|
}
|
||||||
|
|
||||||
private var subscriptions: SubscriptionsModel {
|
private var subscriptions: SubscriptionsModel {
|
||||||
|
@ -140,7 +140,7 @@ struct ControlsOverlay: View {
|
|||||||
}
|
}
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
.buttonStyle(.bordered)
|
.buttonStyle(.bordered)
|
||||||
#else
|
#elseif os(tvOS)
|
||||||
.modifier(ControlBackgroundModifier())
|
.modifier(ControlBackgroundModifier())
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 4))
|
.clipShape(RoundedRectangle(cornerRadius: 4))
|
||||||
#endif
|
#endif
|
||||||
|
@ -66,28 +66,40 @@ struct VideoPlayerView: View {
|
|||||||
|
|
||||||
if playerControls.presentingControlsOverlay {
|
if playerControls.presentingControlsOverlay {
|
||||||
HStack {
|
HStack {
|
||||||
ControlsOverlay()
|
HStack {
|
||||||
#if os(tvOS)
|
#if !os(tvOS)
|
||||||
.onExitCommand {
|
Spacer()
|
||||||
withAnimation(PlayerControls.animation) {
|
#endif
|
||||||
playerControls.hideOverlays()
|
ControlsOverlay()
|
||||||
|
#if os(tvOS)
|
||||||
|
.onExitCommand {
|
||||||
|
withAnimation(PlayerControls.animation) {
|
||||||
|
playerControls.hideOverlays()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
.onPlayPauseCommand {
|
||||||
.onPlayPauseCommand {
|
player.togglePlay()
|
||||||
player.togglePlay()
|
}
|
||||||
}
|
#endif
|
||||||
#else
|
|
||||||
.frame(maxWidth: overlayWidth)
|
|
||||||
#endif
|
|
||||||
.padding()
|
.padding()
|
||||||
.modifier(ControlBackgroundModifier())
|
.modifier(ControlBackgroundModifier())
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 4))
|
.clipShape(RoundedRectangle(cornerRadius: 4))
|
||||||
.transition(.opacity)
|
.transition(.opacity)
|
||||||
|
|
||||||
|
#if !os(tvOS)
|
||||||
|
Spacer()
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
#if os(macOS)
|
||||||
|
.frame(width: player.playerSize.width)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !os(tvOS)
|
||||||
|
Spacer()
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
#if os(tvOS)
|
#if os(tvOS)
|
||||||
.clipShape(RoundedRectangle(cornerRadius: 10))
|
.clipShape(RoundedRectangle(cornerRadius: 10))
|
||||||
#else
|
|
||||||
.frame(maxWidth: player.playerSize.width)
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,9 +117,9 @@ struct VideoPlayerView: View {
|
|||||||
return GeometryReader { geometry in
|
return GeometryReader { geometry in
|
||||||
HSplitView {
|
HSplitView {
|
||||||
content
|
content
|
||||||
.onAppear {
|
}
|
||||||
playerSize = geometry.size
|
.onAppear {
|
||||||
}
|
playerSize = geometry.size
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
.alert(isPresented: $navigation.presentingAlertInVideoPlayer) { navigation.alert }
|
.alert(isPresented: $navigation.presentingAlertInVideoPlayer) { navigation.alert }
|
||||||
|
Loading…
Reference in New Issue
Block a user