rework quality settings

- The order of the formats can now be changed in the Quality Settings.
- sortingOrder is now part of QualitiyProfile.
- bestPlayable is now part of PlayerBackend.
- hls and stream aren't treated as unknown anymore.
This commit is contained in:
Toni Förster
2024-04-26 12:27:25 +02:00
parent d1cf45c6a1
commit 54915dcea1
10 changed files with 191 additions and 151 deletions

View File

@@ -9,9 +9,23 @@ struct MultiselectRow: View {
@State private var toggleChecked = false
var body: some View {
#if os(macOS)
#if os(tvOS)
Button(action: { action(!selected) }) {
HStack {
Text(self.title)
Spacer()
if selected {
Image(systemName: "checkmark")
}
}
.contentShape(Rectangle())
}
.disabled(disabled)
#else
Toggle(title, isOn: $toggleChecked)
#if os(macOS)
.toggleStyle(.checkbox)
#endif
.onAppear {
guard !disabled else { return }
toggleChecked = selected
@@ -19,24 +33,6 @@ struct MultiselectRow: View {
.onChange(of: toggleChecked) { new in
action(new)
}
#else
Button(action: { action(!selected) }) {
HStack {
Text(self.title)
Spacer()
if selected {
Image(systemName: "checkmark")
#if os(iOS)
.foregroundColor(.accentColor)
#endif
}
}
.contentShape(Rectangle())
}
.disabled(disabled)
#if !os(tvOS)
.buttonStyle(.plain)
#endif
#endif
}
}