diff --git a/src/main/kotlin/androidx/compose/material/DialogButton.kt b/src/main/kotlin/androidx/compose/material/DialogButton.kt index e16456ff831789a851088a66f2f2d18a523ccef6..27a767e46ec2e8a5710a6f382b17bf838cd0afde 100644 --- a/src/main/kotlin/androidx/compose/material/DialogButton.kt +++ b/src/main/kotlin/androidx/compose/material/DialogButton.kt @@ -25,8 +25,8 @@ import org.briarproject.briar.desktop.theme.buttonTextPositive import java.util.Locale enum class ButtonType { - POSITIVE, - NEGATIVE, + NEUTRAL, + DESTRUCTIVE, } @Composable @@ -40,8 +40,8 @@ fun DialogButton( text.uppercase(Locale.getDefault()), fontSize = 16.sp, color = when (type) { - ButtonType.POSITIVE -> MaterialTheme.colors.buttonTextPositive - ButtonType.NEGATIVE -> MaterialTheme.colors.buttonTextNegative + ButtonType.NEUTRAL -> MaterialTheme.colors.buttonTextPositive + ButtonType.DESTRUCTIVE -> MaterialTheme.colors.buttonTextNegative }, ) } diff --git a/src/main/kotlin/org/briarproject/briar/desktop/contact/add/remote/AddContactDialog.kt b/src/main/kotlin/org/briarproject/briar/desktop/contact/add/remote/AddContactDialog.kt index 4e22dac458691bb3420d6ff128e35cacd101f06e..840c0834b257ff04534034d22c3d1055b68aa708 100644 --- a/src/main/kotlin/org/briarproject/briar/desktop/contact/add/remote/AddContactDialog.kt +++ b/src/main/kotlin/org/briarproject/briar/desktop/contact/add/remote/AddContactDialog.kt @@ -26,8 +26,7 @@ import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width import androidx.compose.foundation.layout.widthIn import androidx.compose.material.AlertDialog -import androidx.compose.material.ButtonType.NEGATIVE -import androidx.compose.material.ButtonType.POSITIVE +import androidx.compose.material.ButtonType.NEUTRAL import androidx.compose.material.DialogButton import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material.Icon @@ -194,8 +193,8 @@ fun AddContactDialog( } } }, - confirmButton = { DialogButton(onClick = onSubmitAddContactDialog, text = i18n("add"), type = POSITIVE) }, - dismissButton = { DialogButton(onClick = onClose, text = i18n("cancel"), type = NEGATIVE) }, + confirmButton = { DialogButton(onClick = onSubmitAddContactDialog, text = i18n("add"), type = NEUTRAL) }, + dismissButton = { DialogButton(onClick = onClose, text = i18n("cancel"), type = NEUTRAL) }, ) if (error != null) { val (type, title, message) = errorMessage(error) @@ -205,7 +204,7 @@ fun AddContactDialog( } AlertDialog( onDismissRequest = onErrorDialogDismissed, - confirmButton = { DialogButton(onClick = onErrorDialogDismissed, text = i18n("ok"), type = POSITIVE) }, + confirmButton = { DialogButton(onClick = onErrorDialogDismissed, text = i18n("ok"), type = NEUTRAL) }, modifier = Modifier.widthIn(min = DIALOG_WIDTH), title = { Row( diff --git a/src/main/kotlin/org/briarproject/briar/desktop/conversation/ConversationDialogs.kt b/src/main/kotlin/org/briarproject/briar/desktop/conversation/ConversationDialogs.kt index 3ad127a00a683bdf5f6f02ec6bdf3f6c6b6a04b2..20db970bae02777284e230b45bf42892cae0bb5e 100644 --- a/src/main/kotlin/org/briarproject/briar/desktop/conversation/ConversationDialogs.kt +++ b/src/main/kotlin/org/briarproject/briar/desktop/conversation/ConversationDialogs.kt @@ -20,12 +20,14 @@ package org.briarproject.briar.desktop.conversation import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.IntrinsicSize +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width import androidx.compose.material.AlertDialog import androidx.compose.material.Button -import androidx.compose.material.ButtonType.NEGATIVE -import androidx.compose.material.ButtonType.POSITIVE +import androidx.compose.material.ButtonType.DESTRUCTIVE +import androidx.compose.material.ButtonType.NEUTRAL import androidx.compose.material.DialogButton import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material.Text @@ -113,8 +115,8 @@ fun DeleteAllMessagesConfirmationDialog( text = { Text(i18n("conversation.delete.all.dialog.message")) }, - dismissButton = { DialogButton(onClick = { close(); onCancel() }, text = i18n("cancel"), type = NEGATIVE) }, - confirmButton = { DialogButton(onClick = { close(); onDelete() }, text = i18n("delete"), type = POSITIVE) }, + dismissButton = { DialogButton(onClick = { close(); onCancel() }, text = i18n("cancel"), type = NEUTRAL) }, + confirmButton = { DialogButton(onClick = { close(); onDelete() }, text = i18n("delete"), type = DESTRUCTIVE) }, ) } @@ -160,7 +162,7 @@ fun DeleteAllMessagesFailedDialog( text = { Text(message) }, - confirmButton = { DialogButton(onClick = close, text = i18n("ok"), type = POSITIVE) }, + confirmButton = { DialogButton(onClick = close, text = i18n("ok"), type = NEUTRAL) }, ) } @@ -185,10 +187,13 @@ fun ChangeAliasDialog( ) }, text = { - TextField(alias, setAlias) + Column { + Spacer(modifier = Modifier.height(80.dp)) + TextField(alias, setAlias) + } }, - dismissButton = { DialogButton(onClick = { close(); onCancel() }, text = i18n("cancel"), type = NEGATIVE) }, - confirmButton = { DialogButton(onClick = { close(); onConfirm() }, text = i18n("change"), type = POSITIVE) }, + dismissButton = { DialogButton(onClick = { close(); onCancel() }, text = i18n("cancel"), type = NEUTRAL) }, + confirmButton = { DialogButton(onClick = { close(); onConfirm() }, text = i18n("change"), type = NEUTRAL) }, ) } @@ -213,7 +218,7 @@ fun DeleteContactConfirmationDialog( text = { Text(i18n("conversation.delete.contact.dialog.message")) }, - dismissButton = { DialogButton(onClick = { close(); onCancel() }, text = i18n("cancel"), type = NEGATIVE) }, - confirmButton = { DialogButton(onClick = { close(); onDelete() }, text = i18n("delete"), type = POSITIVE) }, + dismissButton = { DialogButton(onClick = { close(); onCancel() }, text = i18n("cancel"), type = NEUTRAL) }, + confirmButton = { DialogButton(onClick = { close(); onDelete() }, text = i18n("delete"), type = DESTRUCTIVE) }, ) } diff --git a/src/main/kotlin/org/briarproject/briar/desktop/conversation/ConversationRequestItemView.kt b/src/main/kotlin/org/briarproject/briar/desktop/conversation/ConversationRequestItemView.kt index 6ffd124281234d51de7edd3d7eed98c90d540cd0..00e448f28c8f224316545d401ae2b1a80f9d9b5e 100644 --- a/src/main/kotlin/org/briarproject/briar/desktop/conversation/ConversationRequestItemView.kt +++ b/src/main/kotlin/org/briarproject/briar/desktop/conversation/ConversationRequestItemView.kt @@ -27,8 +27,8 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.width -import androidx.compose.material.ButtonType.NEGATIVE -import androidx.compose.material.ButtonType.POSITIVE +import androidx.compose.material.ButtonType.DESTRUCTIVE +import androidx.compose.material.ButtonType.NEUTRAL import androidx.compose.material.DialogButton import androidx.compose.material.MaterialTheme import androidx.compose.material.Text @@ -122,10 +122,10 @@ fun ConversationRequestItemView( Row(modifier = Modifier.align(statusAlignment)) { if (!m.answered) { - DialogButton(onClick = { onResponse(false) }, text = i18n("decline"), type = NEGATIVE) - DialogButton(onClick = { onResponse(false) }, text = i18n("accept"), type = POSITIVE) + DialogButton(onClick = { onResponse(false) }, text = i18n("decline"), type = DESTRUCTIVE) + DialogButton(onClick = { onResponse(false) }, text = i18n("accept"), type = NEUTRAL) } else if (m.canBeOpened) { - DialogButton(onClick = onOpenRequestedShareable, text = i18n("open"), type = POSITIVE) + DialogButton(onClick = onOpenRequestedShareable, text = i18n("open"), type = NEUTRAL) } else { Spacer(Modifier.height(8.dp)) } diff --git a/src/main/kotlin/org/briarproject/briar/desktop/login/LoginScreen.kt b/src/main/kotlin/org/briarproject/briar/desktop/login/LoginScreen.kt index 4d9b4cea0d7442cf25d431bdfeefdea8b96e7ba9..f1413a50ad4354c9688b4dff5fadecda576ff912 100644 --- a/src/main/kotlin/org/briarproject/briar/desktop/login/LoginScreen.kt +++ b/src/main/kotlin/org/briarproject/briar/desktop/login/LoginScreen.kt @@ -22,8 +22,8 @@ import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.width import androidx.compose.foundation.text.KeyboardOptions import androidx.compose.material.AlertDialog -import androidx.compose.material.ButtonType.NEGATIVE -import androidx.compose.material.ButtonType.POSITIVE +import androidx.compose.material.ButtonType.DESTRUCTIVE +import androidx.compose.material.ButtonType.NEUTRAL import androidx.compose.material.DialogButton import androidx.compose.material.ExperimentalMaterialApi import androidx.compose.material.OutlinedTextField @@ -91,7 +91,7 @@ fun LoginScreen( DialogButton( onClick = viewHolder::closeDecryptionFailedDialog, text = i18n("ok"), - type = POSITIVE + type = NEUTRAL ) }, ) @@ -133,10 +133,10 @@ fun LoginForm( title = { Text(i18n("startup.password_forgotten.title")) }, text = { Text(i18n("startup.password_forgotten.text")) }, dismissButton = { - DialogButton(onClick = closeDialog, text = i18n("cancel"), type = NEGATIVE) + DialogButton(onClick = closeDialog, text = i18n("cancel"), type = NEUTRAL) }, confirmButton = { - DialogButton(onClick = { deleteAccount(); closeDialog() }, text = i18n("delete"), type = POSITIVE) + DialogButton(onClick = { deleteAccount(); closeDialog() }, text = i18n("delete"), type = DESTRUCTIVE) }, modifier = Modifier.width(500.dp) )