mirror of
https://github.com/yattee/yattee.git
synced 2025-01-08 22:07:10 +00:00
Fixed controls bar model
This commit is contained in:
parent
b5e8fb9024
commit
7af53a04ce
@ -18,6 +18,8 @@ struct ControlsBar: View {
|
||||
@EnvironmentObject<RecentsModel> private var recents
|
||||
@EnvironmentObject<SubscriptionsModel> private var subscriptions
|
||||
|
||||
@ObservedObject private var controls = PlayerControlsModel.shared
|
||||
|
||||
var presentingControls = true
|
||||
var backgroundEnabled = true
|
||||
var borderTop = true
|
||||
@ -33,7 +35,7 @@ struct ControlsBar: View {
|
||||
detailsButton
|
||||
|
||||
if presentingControls {
|
||||
controls
|
||||
controlsView
|
||||
.frame(maxWidth: 120)
|
||||
}
|
||||
}
|
||||
@ -66,7 +68,7 @@ struct ControlsBar: View {
|
||||
} else if detailsToggleFullScreen {
|
||||
Button {
|
||||
controlsOverlayModel.presenting = false
|
||||
model.controls.presentingControls = false
|
||||
controls.presentingControls = false
|
||||
withAnimation {
|
||||
fullScreen.toggle()
|
||||
}
|
||||
@ -82,10 +84,10 @@ struct ControlsBar: View {
|
||||
}
|
||||
}
|
||||
|
||||
var controls: some View {
|
||||
var controlsView: some View {
|
||||
HStack(spacing: 4) {
|
||||
Group {
|
||||
if model.controls.isPlaying {
|
||||
if controls.isPlaying {
|
||||
Button(action: {
|
||||
model.pause()
|
||||
}) {
|
||||
@ -105,7 +107,7 @@ struct ControlsBar: View {
|
||||
}
|
||||
}
|
||||
}
|
||||
.disabled(model.controls.isLoadingVideo || model.currentItem.isNil)
|
||||
.disabled(controls.isLoadingVideo || model.currentItem.isNil)
|
||||
|
||||
Button(action: { model.advanceToNextItem() }) {
|
||||
Label("Next", systemImage: "forward.fill")
|
||||
|
Loading…
Reference in New Issue
Block a user