Use video context menu ControlGroup only on iOS

This commit is contained in:
Arkadiusz Fal
2026-04-15 05:13:57 +02:00
parent 43f62d997f
commit e141a168f0

View File

@@ -235,23 +235,8 @@ struct VideoContextMenuContent: View {
appEnvironment?.dataManager.watchEntry(for: video.id.videoID)?.isFinished ?? false
}
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()
}
ControlGroup {
@ViewBuilder
private var playDownloadShareButtons: some View {
// Play (hidden in player context since video is already playing)
if showPlayAction {
Button {
@@ -301,6 +286,30 @@ struct VideoContextMenuContent: View {
#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)
if showPlayAction, let startTime, startTime > 0 {
Button {