mirror of
https://github.com/yattee/yattee.git
synced 2024-12-15 14:50:32 +05:30
Fix rate button
This commit is contained in:
parent
7e7aca08a0
commit
a4fb39a0d7
@ -217,7 +217,7 @@ final class MPVBackend: PlayerBackend {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func setRate(_ rate: Float) {
|
func setRate(_ rate: Float) {
|
||||||
client.setDoubleAsync("speed", Double(rate))
|
client?.setDoubleAsync("speed", Double(rate))
|
||||||
}
|
}
|
||||||
|
|
||||||
func closeItem() {}
|
func closeItem() {}
|
||||||
|
@ -196,12 +196,12 @@ struct PlayerControls: View {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
private var rateButton: some View {
|
@ViewBuilder private var rateButton: some View {
|
||||||
#if os(macOS)
|
#if os(macOS)
|
||||||
ratePicker
|
ratePicker
|
||||||
.labelsHidden()
|
.labelsHidden()
|
||||||
.frame(maxWidth: 70)
|
.frame(maxWidth: 70)
|
||||||
#else
|
#elseif os(iOS)
|
||||||
Menu {
|
Menu {
|
||||||
ratePicker
|
ratePicker
|
||||||
.frame(width: 45, height: 30)
|
.frame(width: 45, height: 30)
|
||||||
@ -212,9 +212,16 @@ struct PlayerControls: View {
|
|||||||
} label: {
|
} label: {
|
||||||
Text(player.rateLabel(player.currentRate))
|
Text(player.rateLabel(player.currentRate))
|
||||||
.foregroundColor(.primary)
|
.foregroundColor(.primary)
|
||||||
.frame(maxWidth: .infinity)
|
|
||||||
}
|
}
|
||||||
|
.buttonStyle(.plain)
|
||||||
|
.foregroundColor(.primary)
|
||||||
|
.frame(width: 50, height: 30)
|
||||||
|
#if os(macOS)
|
||||||
|
.background(VisualEffectBlur(material: .hudWindow))
|
||||||
|
#elseif os(iOS)
|
||||||
|
.background(VisualEffectBlur(blurStyle: .systemThinMaterial))
|
||||||
|
#endif
|
||||||
|
.mask(RoundedRectangle(cornerRadius: 3))
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user