Use better ButtonDefaults method.

It should not change anything since we are providing the 4 parameters
This commit is contained in:
Benoit Marty
2026-07-10 11:53:52 +02:00
parent 02a40cf2d5
commit a2f1e9eeec
@@ -294,7 +294,7 @@ internal enum class ButtonStyle {
@Composable @Composable
fun getColors(destructive: Boolean): ButtonColors = when (this) { fun getColors(destructive: Boolean): ButtonColors = when (this) {
Filled -> ButtonDefaults.buttonColors( Filled -> ButtonDefaults.filledTonalButtonColors(
containerColor = getPrimaryColor(destructive), containerColor = getPrimaryColor(destructive),
contentColor = ElementTheme.materialColors.onPrimary, contentColor = ElementTheme.materialColors.onPrimary,
disabledContainerColor = if (destructive) { disabledContainerColor = if (destructive) {
@@ -304,13 +304,13 @@ internal enum class ButtonStyle {
}, },
disabledContentColor = ElementTheme.colors.textOnSolidPrimary disabledContentColor = ElementTheme.colors.textOnSolidPrimary
) )
Outlined -> ButtonDefaults.buttonColors( Outlined -> ButtonDefaults.outlinedButtonColors(
containerColor = Color.Transparent, containerColor = Color.Transparent,
contentColor = getPrimaryColor(destructive), contentColor = getPrimaryColor(destructive),
disabledContainerColor = Color.Transparent, disabledContainerColor = Color.Transparent,
disabledContentColor = getDisabledContentColor(destructive), disabledContentColor = getDisabledContentColor(destructive),
) )
Text -> ButtonDefaults.buttonColors( Text -> ButtonDefaults.textButtonColors(
containerColor = Color.Transparent, containerColor = Color.Transparent,
contentColor = if (destructive) { contentColor = if (destructive) {
ElementTheme.colors.textCriticalPrimary ElementTheme.colors.textCriticalPrimary