Files
yattee/Shared/Views/SettingsPickerModifier.swift
Arkadiusz Fal 6aef3f10b1 Improve playback settings UI controls on macOS
Standardized picker and button sizing with consistent alignment and control sizes. Added SettingsPickerModifier to all macOS pickers with menu style. Improved rate buttons with proper sizing and alignment. Added text truncation for stream descriptions to prevent overflow.
2025-11-14 19:28:26 +01:00

32 lines
714 B
Swift

import Foundation
import SwiftUI
struct SettingsPickerModifier: ViewModifier {
func body(content: Content) -> some View {
#if os(tvOS)
content
.pickerStyle(.inline)
.onAppear {
// Force refresh to apply button style to picker options
}
#elseif os(iOS)
content
.pickerStyle(.automatic)
#else
content
.labelsHidden()
.pickerStyle(.menu)
#endif
}
}
#if os(tvOS)
// Extension to help remove picker row backgrounds
extension View {
func pickerRowStyle() -> some View {
self.buttonStyle(.plain)
.listRowBackground(Color.clear)
}
}
#endif