mirror of
https://github.com/yattee/yattee.git
synced 2024-12-13 22:00:31 +05:30
Fix settings overlay layout
This commit is contained in:
parent
62769016fc
commit
356f8c7af1
@ -51,7 +51,7 @@ struct FixtureEnvironmentObjectsModifier: ViewModifier {
|
||||
}
|
||||
|
||||
private var playerControls: PlayerControlsModel {
|
||||
PlayerControlsModel(presentingControls: true, presentingControlsOverlay: false, player: player)
|
||||
PlayerControlsModel(presentingControls: false, presentingControlsOverlay: true, player: player)
|
||||
}
|
||||
|
||||
private var subscriptions: SubscriptionsModel {
|
||||
|
@ -140,7 +140,7 @@ struct ControlsOverlay: View {
|
||||
}
|
||||
#if os(macOS)
|
||||
.buttonStyle(.bordered)
|
||||
#else
|
||||
#elseif os(tvOS)
|
||||
.modifier(ControlBackgroundModifier())
|
||||
.clipShape(RoundedRectangle(cornerRadius: 4))
|
||||
#endif
|
||||
|
@ -66,6 +66,10 @@ struct VideoPlayerView: View {
|
||||
|
||||
if playerControls.presentingControlsOverlay {
|
||||
HStack {
|
||||
HStack {
|
||||
#if !os(tvOS)
|
||||
Spacer()
|
||||
#endif
|
||||
ControlsOverlay()
|
||||
#if os(tvOS)
|
||||
.onExitCommand {
|
||||
@ -76,18 +80,26 @@ struct VideoPlayerView: View {
|
||||
.onPlayPauseCommand {
|
||||
player.togglePlay()
|
||||
}
|
||||
#else
|
||||
.frame(maxWidth: overlayWidth)
|
||||
#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,11 +117,11 @@ struct VideoPlayerView: View {
|
||||
return GeometryReader { geometry in
|
||||
HSplitView {
|
||||
content
|
||||
}
|
||||
.onAppear {
|
||||
playerSize = geometry.size
|
||||
}
|
||||
}
|
||||
}
|
||||
.alert(isPresented: $navigation.presentingAlertInVideoPlayer) { navigation.alert }
|
||||
.onOpenURL {
|
||||
OpenURLHandler(
|
||||
|
Loading…
Reference in New Issue
Block a user