fix(ui): Improve colors

This commit is contained in:
Myzel394 2023-10-22 13:50:26 +02:00
parent d88b03142f
commit 35cff4b6eb
No known key found for this signature in database
GPG Key ID: 79CC92F37B3E1A2B

View File

@ -46,6 +46,9 @@ fun MicrophoneSelectionButton(
.collectAsState(initial = AppSettings.getDefaultInstance()) .collectAsState(initial = AppSettings.getDefaultInstance())
.value .value
// Copied from Android's [FilledButtonTokens]
val disabledTextColor = MaterialTheme.colorScheme.onSurface.copy(alpha = 0.38f)
Button( Button(
onClick = onSelect, onClick = onSelect,
enabled = !disabled, enabled = !disabled,
@ -72,7 +75,7 @@ fun MicrophoneSelectionButton(
Text( Text(
microphone.deviceInfo.address.toString(), microphone.deviceInfo.address.toString(),
fontSize = MaterialTheme.typography.bodySmall.toSpanStyle().fontSize, fontSize = MaterialTheme.typography.bodySmall.toSpanStyle().fontSize,
color = if (selected || disabled) MaterialTheme.colorScheme.onPrimary else MaterialTheme.colorScheme.secondary, color = if (disabled) disabledTextColor else if (selected) MaterialTheme.colorScheme.onPrimary else MaterialTheme.colorScheme.secondary,
) )
} }
if (selectedAsFallback) if (selectedAsFallback)