From fc84306bcc741b484ea7a0446f1fe2eb01ad9757 Mon Sep 17 00:00:00 2001 From: fscarponi Date: Fri, 13 Oct 2023 09:36:50 +0200 Subject: [PATCH] IconButton border hotfix --- core/src/main/kotlin/org/jetbrains/jewel/IconButton.kt | 6 ++---- .../kotlin/org/jetbrains/jewel/styling/IconButtonMetrics.kt | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/core/src/main/kotlin/org/jetbrains/jewel/IconButton.kt b/core/src/main/kotlin/org/jetbrains/jewel/IconButton.kt index 3b6d9a428..61b4e4a2f 100644 --- a/core/src/main/kotlin/org/jetbrains/jewel/IconButton.kt +++ b/core/src/main/kotlin/org/jetbrains/jewel/IconButton.kt @@ -20,7 +20,6 @@ import androidx.compose.runtime.remember import androidx.compose.runtime.setValue import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier -import androidx.compose.ui.draw.clip import androidx.compose.ui.semantics.Role import org.jetbrains.jewel.styling.IconButtonStyle @@ -70,10 +69,9 @@ fun IconButton( interactionSource = interactionSource, indication = NoIndication, ) - .clip(shape) .padding(style.metrics.padding) - .background(background) - .border(style.metrics.borderWidth, border), + .background(background, shape) + .border(style.metrics.borderWidth, border, shape), contentAlignment = Alignment.Center, content = { content(buttonState) diff --git a/core/src/main/kotlin/org/jetbrains/jewel/styling/IconButtonMetrics.kt b/core/src/main/kotlin/org/jetbrains/jewel/styling/IconButtonMetrics.kt index 04541a1b1..c34923395 100644 --- a/core/src/main/kotlin/org/jetbrains/jewel/styling/IconButtonMetrics.kt +++ b/core/src/main/kotlin/org/jetbrains/jewel/styling/IconButtonMetrics.kt @@ -49,9 +49,9 @@ interface IconButtonColors { fun borderFor(state: ButtonState) = rememberUpdatedState( when { !state.isEnabled -> borderDisabled + state.isFocused -> borderFocused state.isPressed -> borderPressed state.isHovered -> borderHovered - state.isFocused -> borderFocused else -> border }, )