mirror of
https://github.com/yattee/yattee.git
synced 2025-01-09 22:37:09 +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<RecentsModel> private var recents
|
||||||
@EnvironmentObject<SubscriptionsModel> private var subscriptions
|
@EnvironmentObject<SubscriptionsModel> private var subscriptions
|
||||||
|
|
||||||
|
@ObservedObject private var controls = PlayerControlsModel.shared
|
||||||
|
|
||||||
var presentingControls = true
|
var presentingControls = true
|
||||||
var backgroundEnabled = true
|
var backgroundEnabled = true
|
||||||
var borderTop = true
|
var borderTop = true
|
||||||
@ -33,7 +35,7 @@ struct ControlsBar: View {
|
|||||||
detailsButton
|
detailsButton
|
||||||
|
|
||||||
if presentingControls {
|
if presentingControls {
|
||||||
controls
|
controlsView
|
||||||
.frame(maxWidth: 120)
|
.frame(maxWidth: 120)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -66,7 +68,7 @@ struct ControlsBar: View {
|
|||||||
} else if detailsToggleFullScreen {
|
} else if detailsToggleFullScreen {
|
||||||
Button {
|
Button {
|
||||||
controlsOverlayModel.presenting = false
|
controlsOverlayModel.presenting = false
|
||||||
model.controls.presentingControls = false
|
controls.presentingControls = false
|
||||||
withAnimation {
|
withAnimation {
|
||||||
fullScreen.toggle()
|
fullScreen.toggle()
|
||||||
}
|
}
|
||||||
@ -82,10 +84,10 @@ struct ControlsBar: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var controls: some View {
|
var controlsView: some View {
|
||||||
HStack(spacing: 4) {
|
HStack(spacing: 4) {
|
||||||
Group {
|
Group {
|
||||||
if model.controls.isPlaying {
|
if controls.isPlaying {
|
||||||
Button(action: {
|
Button(action: {
|
||||||
model.pause()
|
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() }) {
|
Button(action: { model.advanceToNextItem() }) {
|
||||||
Label("Next", systemImage: "forward.fill")
|
Label("Next", systemImage: "forward.fill")
|
||||||
|
Loading…
Reference in New Issue
Block a user