From 5bcb62b306b715d19834d8995286c047b931cf4c Mon Sep 17 00:00:00 2001 From: Stanislav Dmitrenko <7953703+avently@users.noreply.github.com> Date: Tue, 15 Aug 2023 00:26:36 +0300 Subject: [PATCH] desktop: alert style in protocol servers (#2928) --- .../common/views/helpers/AlertManager.kt | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/AlertManager.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/AlertManager.kt index b5de31bfea..49a7ad748f 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/AlertManager.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/helpers/AlertManager.kt @@ -51,26 +51,31 @@ class AlertManager { buttons: @Composable () -> Unit, ) { showAlert { - DefaultDialog(onDismissRequest = ::hideAlert) { - Column( - Modifier - .background(MaterialTheme.colors.surface, RoundedCornerShape(corner = CornerSize(25.dp))) - .padding(bottom = DEFAULT_PADDING) - ) { + AlertDialog( + onDismissRequest = ::hideAlert, + title = { Text( title, Modifier.fillMaxWidth().padding(vertical = DEFAULT_PADDING), textAlign = TextAlign.Center, fontSize = 20.sp ) - CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.high) { - if (text != null) { - Text(text, Modifier.fillMaxWidth().padding(start = DEFAULT_PADDING, end = DEFAULT_PADDING, bottom = DEFAULT_PADDING * 1.5f), fontSize = 16.sp, textAlign = TextAlign.Center, color = MaterialTheme.colors.secondary) + }, + buttons = { + Column( + Modifier + .padding(bottom = DEFAULT_PADDING) + ) { + CompositionLocalProvider(LocalContentAlpha provides ContentAlpha.high) { + if (text != null) { + Text(text, Modifier.fillMaxWidth().padding(start = DEFAULT_PADDING, end = DEFAULT_PADDING, bottom = DEFAULT_PADDING * 1.5f), fontSize = 16.sp, textAlign = TextAlign.Center, color = MaterialTheme.colors.secondary) + } + buttons() } - buttons() } - } - } + }, + shape = RoundedCornerShape(corner = CornerSize(25.dp)) + ) } }