Gordon
07/31/2022, 7:18 AMobject CustomDialogProvider : AlertDialogProvider {
@OptIn(ExperimentalComposeUiApi::class)
@Composable
override fun AlertDialog(
onDismissRequest: () -> Unit,
content: @Composable () -> Unit,
) {
val painter = rememberVectorPainter(image = <http://Icons.Default.Engineering|Icons.Default.Engineering>)
Dialog(
title = "My Awesome Title",
icon = painter,
onCloseRequest = onDismissRequest,
state = rememberDialogState(position = WindowPosition.Aligned(Alignment.Center), size = DpSize(400.dp, 200.dp)),
undecorated = false,
resizable = false,
onKeyEvent = {
if (it.key == Key.Escape) {
onDismissRequest()
true
} else {
false
}
},
) {
WindowDraggableArea {
content()
}
}
}
}
But the dialog shows centered in the Screen, and in multi-monitor, it's not even on the correct monitor.
So, my app, runs on Monitor 1, and the dialog shows Centered on Monitor 0.
And i want it Centered on Monitor 1, and not the entire screen, centered in application window.