diff --git a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/screens/FullscreenViewBase.kt b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/screens/FullscreenViewBase.kt index de45943..75c7417 100644 --- a/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/screens/FullscreenViewBase.kt +++ b/composeApp/src/commonMain/kotlin/net/codinux/banking/ui/screens/FullscreenViewBase.kt @@ -10,6 +10,8 @@ import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.text.style.TextAlign import androidx.compose.ui.unit.dp +import androidx.compose.ui.window.Dialog +import androidx.compose.ui.window.DialogProperties import androidx.compose.ui.zIndex import net.codinux.banking.ui.composables.text.HeaderText import net.codinux.banking.ui.config.Colors @@ -23,35 +25,40 @@ fun FullscreenViewBase( onClosed: () -> Unit, content: @Composable () -> Unit ) { - Column(Modifier.fillMaxSize().zIndex(1000f).background(Color.White).padding(8.dp)) { + Dialog( + onClosed, + properties = DialogProperties(usePlatformDefaultWidth = false) + ) { + Column(Modifier.fillMaxSize().zIndex(1000f).background(Color.White).padding(8.dp)) { - Row(Modifier.fillMaxWidth()) { - HeaderText(title, Modifier.padding(top = 8.dp, bottom = 16.dp).weight(1f)) + Row(Modifier.fillMaxWidth()) { + HeaderText(title, Modifier.padding(top = 8.dp, bottom = 16.dp).weight(1f)) - if (DI.platform.isDesktop) { - TextButton(onClosed, colors = ButtonDefaults.buttonColors(contentColor = Colors.Zinc700, backgroundColor = Color.Transparent)) { - Icon(Icons.Filled.Close, contentDescription = "Close dialog", Modifier.size(32.dp)) + if (DI.platform.isDesktop) { + TextButton(onClosed, colors = ButtonDefaults.buttonColors(contentColor = Colors.Zinc700, backgroundColor = Color.Transparent)) { + Icon(Icons.Filled.Close, contentDescription = "Close dialog", Modifier.size(32.dp)) + } } } - } - Column(Modifier.fillMaxWidth().weight(1f)) { - content() - } + Column(Modifier.fillMaxWidth().weight(1f)) { + content() + } - Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.End) { + Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.End) { // TextButton(onClick = onClosed, Modifier.width(Style.DialogButtonWidth)) { // Text("Abbrechen", color = Colors.CodinuxSecondaryColor) // } // // Spacer(Modifier.width(8.dp)) - TextButton( - modifier = Modifier.fillMaxWidth(), - enabled = confirmButtonEnabled, - onClick = { /* onConfirm?.invoke() ?: */ onClosed() } - ) { - Text(confirmButtonTitle, color = Colors.CodinuxSecondaryColor, textAlign = TextAlign.Center) + TextButton( + modifier = Modifier.fillMaxWidth(), + enabled = confirmButtonEnabled, + onClick = { /* onConfirm?.invoke() ?: */ onClosed() } + ) { + Text(confirmButtonTitle, color = Colors.CodinuxSecondaryColor, textAlign = TextAlign.Center) + } } } }