mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 10:25:02 +00:00
Use video context menu ControlGroup only on iOS
This commit is contained in:
@@ -235,23 +235,8 @@ struct VideoContextMenuContent: View {
|
|||||||
appEnvironment?.dataManager.watchEntry(for: video.id.videoID)?.isFinished ?? false
|
appEnvironment?.dataManager.watchEntry(for: video.id.videoID)?.isFinished ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
var body: some View {
|
@ViewBuilder
|
||||||
// Custom actions at the top
|
private var playDownloadShareButtons: some View {
|
||||||
ForEach(customActions.indices, id: \.self) { index in
|
|
||||||
let action = customActions[index]
|
|
||||||
Button(role: action.role) {
|
|
||||||
action.action()
|
|
||||||
} label: {
|
|
||||||
Label(action.label, systemImage: action.systemImage)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Divider after custom actions (if any)
|
|
||||||
if !customActions.isEmpty {
|
|
||||||
Divider()
|
|
||||||
}
|
|
||||||
|
|
||||||
ControlGroup {
|
|
||||||
// Play (hidden in player context since video is already playing)
|
// Play (hidden in player context since video is already playing)
|
||||||
if showPlayAction {
|
if showPlayAction {
|
||||||
Button {
|
Button {
|
||||||
@@ -301,6 +286,30 @@ struct VideoContextMenuContent: View {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var body: some View {
|
||||||
|
// Custom actions at the top
|
||||||
|
ForEach(customActions.indices, id: \.self) { index in
|
||||||
|
let action = customActions[index]
|
||||||
|
Button(role: action.role) {
|
||||||
|
action.action()
|
||||||
|
} label: {
|
||||||
|
Label(action.label, systemImage: action.systemImage)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Divider after custom actions (if any)
|
||||||
|
if !customActions.isEmpty {
|
||||||
|
Divider()
|
||||||
|
}
|
||||||
|
|
||||||
|
#if os(iOS)
|
||||||
|
ControlGroup {
|
||||||
|
playDownloadShareButtons
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
playDownloadShareButtons
|
||||||
|
#endif
|
||||||
|
|
||||||
// Play from Beginning (only shown when there's saved progress)
|
// Play from Beginning (only shown when there's saved progress)
|
||||||
if showPlayAction, let startTime, startTime > 0 {
|
if showPlayAction, let startTime, startTime > 0 {
|
||||||
Button {
|
Button {
|
||||||
|
|||||||
Reference in New Issue
Block a user