Skip to content

Commit

Permalink
IconButton: allow disabling minimum size enforcement
Browse files Browse the repository at this point in the history
  • Loading branch information
hrach committed Mar 29, 2023
1 parent 5e188fa commit f12f879
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ public fun IconButton(
modifier: Modifier = Modifier,
enabled: Boolean = true,
rippleRadius: Dp = RippleRadius,
minimumInteractiveComponentEnforcement: Boolean = true,
interactionSource: MutableInteractionSource = remember { MutableInteractionSource() },
content: @Composable () -> Unit,
) {
Expand All @@ -34,7 +35,13 @@ public fun IconButton(
interactionSource = interactionSource,
indication = rememberRipple(bounded = false, radius = rippleRadius),
)
.size(rippleRadius * 2),
.run {
if (minimumInteractiveComponentEnforcement) {
size(rippleRadius * 2)
} else {
this
}
},
contentAlignment = Alignment.Center,
) {
val contentEmphasis = if (enabled) LocalContentEmphasis.current else ContentEmphasis.Disabled
Expand Down

0 comments on commit f12f879

Please sign in to comment.