Skip to content

Commit f425472

Browse files
committed
Change how desktop dialog shape is handeled
1 parent 0a79f30 commit f425472

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

core/src/androidMain/kotlin/com/vanpra/composematerialdialogs/AndroidUtils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ private fun SecurePolicy.toSecureFlagPolicy(): SecureFlagPolicy {
6565
}
6666

6767
@Composable
68-
internal actual fun defaultDialogShape(): Shape = MaterialTheme.shapes.medium
68+
internal actual fun getDialogShape(shape: Shape): Shape = shape
6969

7070
@Composable
7171
internal actual fun ScreenConfiguration.getMaxHeight(): Dp {

core/src/commonMain/kotlin/com/vanpra/composematerialdialogs/MaterialDialog.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ fun MaterialDialog(
213213
dialogState: MaterialDialogState = rememberMaterialDialogState(),
214214
properties: MaterialDialogProperties = MaterialDialogProperties(),
215215
backgroundColor: Color = MaterialTheme.colors.surface,
216-
shape: Shape = defaultDialogShape(),
216+
shape: Shape = MaterialTheme.shapes.medium,
217217
border: BorderStroke? = null,
218218
elevation: Dp = 24.dp,
219219
autoDismiss: Boolean = true,
@@ -252,7 +252,7 @@ fun MaterialDialog(
252252
.clipToBounds()
253253
.dialogHeight()
254254
.testTag("dialog"),
255-
shape = shape,
255+
shape = getDialogShape(shape),
256256
color = backgroundColor,
257257
border = border,
258258
elevation = elevation

core/src/commonMain/kotlin/com/vanpra/composematerialdialogs/Utils.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ data class MaterialDialogProperties(
9090
val resizable: Boolean = true
9191
)
9292

93-
internal expect fun defaultDialogShape(): Shape
93+
internal expect fun getDialogShape(shape: Shape): Shape
9494

9595
@Composable
9696
internal expect fun ScreenConfiguration.getMaxHeight(): Dp

core/src/desktopMain/kotlin/com/vanpra/composematerialdialogs/DesktopUtils.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import androidx.compose.runtime.CompositionLocalProvider
77
import androidx.compose.runtime.compositionLocalOf
88
import androidx.compose.ui.Modifier
99
import androidx.compose.ui.graphics.RectangleShape
10+
import androidx.compose.ui.graphics.Shape
1011
import androidx.compose.ui.unit.Dp
1112
import androidx.compose.ui.unit.DpSize
1213
import androidx.compose.ui.unit.dp
@@ -70,7 +71,7 @@ private fun DesktopWindowPosition.toWindowPosition(): WindowPosition {
7071
}
7172

7273
@Composable
73-
internal actual fun defaultDialogShape() = RectangleShape
74+
internal actual fun getDialogShape(shape: Shape) = RectangleShape
7475

7576
@Composable
7677
internal actual fun ScreenConfiguration.getMaxHeight(): Dp {

0 commit comments

Comments
 (0)