From a9f83450bfcae6608b6a288afb361a56d8c05533 Mon Sep 17 00:00:00 2001 From: "dima.avdeev" <99798741+dima-avdeev-jb@users.noreply.github.com> Date: Thu, 5 Jan 2023 17:58:22 +0300 Subject: [PATCH] Desktop AlertDialog scrim color (#358) https://github.com/JetBrains/compose-jb/issues/2580 Also, add temporary PopupDialog. In the future, it should be changed to LayerDialog.(https://github.com/JetBrains/compose-jb/issues/933) --- .../androidx/compose/material/DesktopAlertDialog.desktop.kt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopAlertDialog.desktop.kt b/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopAlertDialog.desktop.kt index 3515d44c6692e..414c4dc08f93d 100644 --- a/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopAlertDialog.desktop.kt +++ b/compose/material/material/src/desktopMain/kotlin/androidx/compose/material/DesktopAlertDialog.desktop.kt @@ -45,6 +45,7 @@ import androidx.compose.ui.window.PopupPositionProvider import androidx.compose.ui.window.rememberDialogState import java.awt.event.KeyEvent import androidx.compose.ui.window.Dialog as CoreDialog +import androidx.compose.foundation.background import androidx.compose.ui.input.key.KeyEventType import androidx.compose.ui.input.key.type @@ -218,9 +219,11 @@ object PopupAlertDialogProvider : AlertDialogProvider { } }, ) { + val scrimColor = Color.Black.copy(alpha = 0.32f) //todo configure scrim color in function arguments Box( modifier = Modifier .fillMaxSize() + .background(scrimColor) .pointerInput(onDismissRequest) { detectTapGestures(onPress = { onDismissRequest() }) },