New playback settings sheet

This commit is contained in:
Arkadiusz Fal
2022-12-21 21:16:47 +01:00
parent c01ff56854
commit 809bcd183a
14 changed files with 520 additions and 41 deletions

View File

@@ -67,6 +67,9 @@ struct AdvancedSettings: View {
Text("cache-secs")
.frame(minWidth: 140, alignment: .leading)
TextField("cache-secs", text: $mpvCacheSecs)
#if !os(macOS)
.keyboardType(.URL)
#endif
}
.multilineTextAlignment(.trailing)
@@ -74,6 +77,9 @@ struct AdvancedSettings: View {
Text("cache-pause-wait")
.frame(minWidth: 140, alignment: .leading)
TextField("cache-pause-wait", text: $mpvCachePauseWait)
#if !os(macOS)
.keyboardType(.URL)
#endif
}
.multilineTextAlignment(.trailing)

View File

@@ -45,10 +45,6 @@ struct PlayerControlsSettings: View {
List {
sections
}
#if !os(tvOS)
.backport
.scrollDismissesKeyboard()
#endif
#endif
}
#if os(tvOS)
@@ -215,23 +211,23 @@ struct PlayerControlsSettings: View {
HStack {
#if !os(tvOS)
Button {
var intValue = Int(value.wrappedValue) ?? 10
intValue += 5
if intValue <= 0 {
intValue = 5
Label("Plus", systemImage: "plus")
.imageScale(.large)
.labelStyle(.iconOnly)
.padding(7)
.foregroundColor(.accentColor)
#if os(iOS)
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(lineWidth: 1).foregroundColor(.accentColor))
#endif
.contentShape(Rectangle())
.onTapGesture {
var intValue = Int(value.wrappedValue) ?? 10
intValue += 5
if intValue <= 0 {
intValue = 5
}
value.wrappedValue = String(intValue)
}
value.wrappedValue = String(intValue)
} label: {
Label("Plus", systemImage: "plus")
.imageScale(.large)
.padding(7)
.labelStyle(.iconOnly)
.frame(minHeight: 35)
.foregroundColor(.primary)
.contentShape(Rectangle())
}
.background(RoundedRectangle(cornerRadius: 4).stroke(lineWidth: 1))
#endif
#if os(tvOS)
@@ -250,24 +246,24 @@ struct PlayerControlsSettings: View {
#endif
#if !os(tvOS)
Button {
var intValue = Int(value.wrappedValue) ?? 10
intValue -= 5
if intValue <= 0 {
intValue = 5
Label("Minus", systemImage: "minus")
.imageScale(.large)
.labelStyle(.iconOnly)
.padding(7)
.foregroundColor(.accentColor)
#if os(iOS)
.frame(minHeight: 35)
.background(RoundedRectangle(cornerRadius: 4).strokeBorder(lineWidth: 1).foregroundColor(.accentColor))
#endif
.contentShape(Rectangle())
.onTapGesture {
var intValue = Int(value.wrappedValue) ?? 10
intValue -= 5
if intValue <= 0 {
intValue = 5
}
value.wrappedValue = String(intValue)
}
value.wrappedValue = String(intValue)
} label: {
Label("Minus", systemImage: "minus")
.imageScale(.large)
.padding(7)
.labelStyle(.iconOnly)
.frame(minHeight: 35)
.foregroundColor(.primary)
.contentShape(Rectangle())
}
.background(RoundedRectangle(cornerRadius: 4).stroke(lineWidth: 1))
.buttonStyle(.plain)
#endif
}
}

View File

@@ -243,7 +243,7 @@ struct SettingsView: View {
case .player:
return 450
case .controls:
return 800
return 850
case .quality:
return 420
case .history: