mirror of
https://github.com/yattee/yattee.git
synced 2025-11-24 18:28:20 +00:00
Fix tvOS controls overlay button text legibility
Improved text contrast on overlay buttons by: - Applying foreground color directly to button labels to ensure proper override - Using semi-transparent gray background for unfocused buttons instead of Color.secondary - Removing accent color overrides from caption text to respect button styling This ensures readable text in both focused (black on white) and unfocused (white on gray) states.
This commit is contained in:
@@ -24,6 +24,7 @@ struct ControlsOverlayButton<LabelView: View>: View {
|
||||
if let onSelect {
|
||||
Button(action: onSelect) {
|
||||
label
|
||||
.foregroundColor(isFocused ? .black : .white)
|
||||
.padding()
|
||||
.frame(width: 400)
|
||||
}
|
||||
@@ -31,12 +32,12 @@ struct ControlsOverlayButton<LabelView: View>: View {
|
||||
.focused(focusedField, equals: field)
|
||||
} else {
|
||||
label
|
||||
.foregroundColor(isFocused ? .black : .white)
|
||||
.padding()
|
||||
.frame(width: 400)
|
||||
.focusable()
|
||||
.focused(focusedField, equals: field)
|
||||
.background(isFocused ? Color.white : Color.secondary)
|
||||
.foregroundColor(isFocused ? Color.black : Color.white)
|
||||
.background(isFocused ? Color.white : Color.gray.opacity(0.5))
|
||||
.clipShape(RoundedRectangle(cornerRadius: 4))
|
||||
}
|
||||
}
|
||||
@@ -47,8 +48,7 @@ struct TVButtonStyle: ButtonStyle {
|
||||
|
||||
func makeBody(configuration: Configuration) -> some View {
|
||||
configuration.label
|
||||
.background(isFocused ? Color.white : Color.secondary)
|
||||
.foregroundColor(isFocused ? Color.black : Color.white)
|
||||
.background(isFocused ? Color.white : Color.gray.opacity(0.5))
|
||||
.clipShape(RoundedRectangle(cornerRadius: 4))
|
||||
.scaleEffect(configuration.isPressed ? 0.95 : 1.0)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user