mirror of
https://github.com/yattee/yattee.git
synced 2024-12-14 14:20:32 +05:30
Add close video button to browser controls
This commit is contained in:
parent
06a6126eb5
commit
f2e9bcaefe
@ -65,15 +65,6 @@ struct BrowserPlayerControls<Content: View, Toolbar: View>: View {
|
||||
.lineLimit(1)
|
||||
}
|
||||
}
|
||||
.contextMenu {
|
||||
Button {
|
||||
model.closeCurrentItem()
|
||||
} label: {
|
||||
Label("Close Video", systemImage: "xmark.circle")
|
||||
.labelStyle(.automatic)
|
||||
}
|
||||
.disabled(model.currentItem.isNil)
|
||||
}
|
||||
|
||||
Spacer()
|
||||
}
|
||||
@ -82,9 +73,17 @@ struct BrowserPlayerControls<Content: View, Toolbar: View>: View {
|
||||
}
|
||||
.padding(.vertical, 20)
|
||||
|
||||
ZStack(alignment: .bottom) {
|
||||
HStack {
|
||||
Group {
|
||||
if !model.currentItem.isNil {
|
||||
Button {
|
||||
model.closeCurrentItem()
|
||||
model.closePiP()
|
||||
} label: {
|
||||
Label("Close Video", systemImage: "xmark")
|
||||
}
|
||||
}
|
||||
|
||||
if playerControls.isPlaying {
|
||||
Button(action: {
|
||||
model.pause()
|
||||
@ -110,16 +109,6 @@ struct BrowserPlayerControls<Content: View, Toolbar: View>: View {
|
||||
}
|
||||
.disabled(model.queue.isEmpty)
|
||||
}
|
||||
|
||||
ProgressView(value: progressViewValue, total: progressViewTotal)
|
||||
.progressViewStyle(.linear)
|
||||
#if os(iOS)
|
||||
.frame(maxWidth: 60)
|
||||
#else
|
||||
.offset(y: 6)
|
||||
.frame(maxWidth: 70)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
.buttonStyle(.plain)
|
||||
.labelStyle(.iconOnly)
|
||||
|
Loading…
Reference in New Issue
Block a user