mirror of
https://github.com/yattee/yattee.git
synced 2025-08-06 10:44:06 +00:00
Settings for new features
This commit is contained in:
@@ -9,6 +9,8 @@ struct PlayerOverlayModifier: ViewModifier {
|
||||
@Environment(\.navigationStyle) private var navigationStyle
|
||||
|
||||
@Default(.playerButtonShowsControlButtonsWhenMinimized) private var controlsWhenMinimized
|
||||
@Default(.playerButtonIsExpanded) private var playerButtonIsExpanded
|
||||
@Default(.playerBarMaxWidth) private var playerBarMaxWidth
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
content
|
||||
@@ -23,10 +25,20 @@ struct PlayerOverlayModifier: ViewModifier {
|
||||
ControlsBar(fullScreen: .constant(false), expansionState: $expansionState, playerBar: true)
|
||||
.offset(x: expansionState == .mini && !controlsWhenMinimized ? 10 : 0, y: 0)
|
||||
.transition(.opacity)
|
||||
.frame(maxWidth: maxWidth, alignment: .trailing)
|
||||
.onAppear {
|
||||
if playerButtonIsExpanded {
|
||||
expansionState = .full
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
.animation(.default, value: player.currentItem)
|
||||
}
|
||||
|
||||
var maxWidth: Double {
|
||||
playerBarMaxWidth == "0" ? .infinity : (Double(playerBarMaxWidth) ?? 600)
|
||||
}
|
||||
}
|
||||
|
||||
struct PlayerOverlayModifier_Previews: PreviewProvider {
|
||||
|
Reference in New Issue
Block a user