mirror of
https://github.com/yattee/yattee.git
synced 2026-05-12 18:35:05 +00:00
Match tvOS play button background to prev/next transport buttons
This commit is contained in:
@@ -373,18 +373,12 @@ struct TVTransportButtonStyle: ButtonStyle {
|
|||||||
|
|
||||||
func makeBody(configuration: Configuration) -> some View {
|
func makeBody(configuration: Configuration) -> some View {
|
||||||
let size: CGFloat = isPrimary ? 88 : 72
|
let size: CGFloat = isPrimary ? 88 : 72
|
||||||
let style: GlassStyle = {
|
let style: GlassStyle = isFocused ? .tinted(.white.opacity(0.35)) : .regular
|
||||||
if isPrimary {
|
let fallback: GlassFallbackMaterial = isFocused ? .ultraThickMaterial : .ultraThinMaterial
|
||||||
return isFocused ? .tinted(.white.opacity(0.85)) : .tinted(.white.opacity(0.35))
|
|
||||||
} else {
|
|
||||||
return isFocused ? .tinted(.white.opacity(0.35)) : .regular
|
|
||||||
}
|
|
||||||
}()
|
|
||||||
let fallback: GlassFallbackMaterial = (isFocused || isPrimary) ? .ultraThickMaterial : .ultraThinMaterial
|
|
||||||
return configuration.label
|
return configuration.label
|
||||||
.frame(width: size, height: size)
|
.frame(width: size, height: size)
|
||||||
.glassBackground(style, in: .circle, fallback: fallback, colorScheme: .light)
|
.glassBackground(style, in: .circle, fallback: fallback, colorScheme: .light)
|
||||||
.foregroundStyle(isFocused && isPrimary ? Color.black : .white)
|
.foregroundStyle(isFocused ? Color.black : .white)
|
||||||
.scaleEffect(configuration.isPressed ? 0.92 : (isFocused ? 1.08 : 1.0))
|
.scaleEffect(configuration.isPressed ? 0.92 : (isFocused ? 1.08 : 1.0))
|
||||||
.animation(.easeInOut(duration: 0.15), value: isFocused)
|
.animation(.easeInOut(duration: 0.15), value: isFocused)
|
||||||
.animation(.easeInOut(duration: 0.1), value: configuration.isPressed)
|
.animation(.easeInOut(duration: 0.1), value: configuration.isPressed)
|
||||||
|
|||||||
Reference in New Issue
Block a user