Improve AlertDialog for enlarged text

This commit is contained in:
Andrew 2024-06-18 23:23:50 +09:30
parent d43ab8dc8b
commit d57158eb3d

View File

@ -2,8 +2,11 @@ package org.thoughtcrime.securesms.ui
import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.IntrinsicSize
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxWidth import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding import androidx.compose.foundation.layout.padding
import androidx.compose.material.Icon import androidx.compose.material.Icon
import androidx.compose.material.IconButton import androidx.compose.material.IconButton
@ -75,11 +78,12 @@ fun AlertDialog(
} }
} }
buttons?.takeIf { it.isNotEmpty() }?.let { buttons?.takeIf { it.isNotEmpty() }?.let {
Row { Row(Modifier.height(IntrinsicSize.Min)) {
it.forEach { it.forEach {
DialogButton( DialogButton(
text = it.text(), text = it.text(),
modifier = Modifier modifier = Modifier
.fillMaxHeight()
.contentDescription(it.contentDescription()) .contentDescription(it.contentDescription())
.weight(1f) .weight(1f)
) { ) {
@ -106,6 +110,7 @@ fun DialogButton(text: String, modifier: Modifier, onClick: () -> Unit) {
text, text,
color = LocalColors.current.text, color = LocalColors.current.text,
style = largeBold, style = largeBold,
textAlign = TextAlign.Center,
modifier = Modifier.padding( modifier = Modifier.padding(
top = LocalDimensions.current.smallItemSpacing, top = LocalDimensions.current.smallItemSpacing,
bottom = LocalDimensions.current.itemSpacing bottom = LocalDimensions.current.itemSpacing