Avoid badly wrapped buttons in DuplicateMangaDialog

Fixes #9767
This commit is contained in:
arkon 2023-07-29 12:14:11 -04:00
parent f3e9d5f346
commit db788d519d
2 changed files with 21 additions and 13 deletions

View file

@ -1,6 +1,7 @@
package eu.kanade.presentation.manga package eu.kanade.presentation.manga
import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.FlowRow
import androidx.compose.foundation.layout.Spacer import androidx.compose.foundation.layout.Spacer
import androidx.compose.material3.AlertDialog import androidx.compose.material3.AlertDialog
import androidx.compose.material3.Text import androidx.compose.material3.Text
@ -8,6 +9,7 @@ import androidx.compose.material3.TextButton
import androidx.compose.runtime.Composable import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import eu.kanade.tachiyomi.R import eu.kanade.tachiyomi.R
@Composable @Composable
@ -18,15 +20,27 @@ fun DuplicateMangaDialog(
) { ) {
AlertDialog( AlertDialog(
onDismissRequest = onDismissRequest, onDismissRequest = onDismissRequest,
title = {
Text(text = stringResource(R.string.are_you_sure))
},
text = {
Text(text = stringResource(R.string.confirm_add_duplicate_manga))
},
confirmButton = { confirmButton = {
Row { FlowRow(
TextButton(onClick = { horizontalArrangement = Arrangement.spacedBy(4.dp),
onDismissRequest() ) {
onOpenManga() TextButton(
},) { onClick = {
onDismissRequest()
onOpenManga()
},
) {
Text(text = stringResource(R.string.action_show_manga)) Text(text = stringResource(R.string.action_show_manga))
} }
Spacer(modifier = Modifier.weight(1f)) Spacer(modifier = Modifier.weight(1f))
TextButton(onClick = onDismissRequest) { TextButton(onClick = onDismissRequest) {
Text(text = stringResource(R.string.action_cancel)) Text(text = stringResource(R.string.action_cancel))
} }
@ -40,11 +54,5 @@ fun DuplicateMangaDialog(
} }
} }
}, },
title = {
Text(text = stringResource(R.string.are_you_sure))
},
text = {
Text(text = stringResource(R.string.confirm_add_duplicate_manga))
},
) )
} }

View file

@ -121,8 +121,8 @@ internal fun MigrateDialog(
) { ) {
TextButton( TextButton(
onClick = { onClick = {
onClickTitle()
onDismissRequest() onDismissRequest()
onClickTitle()
}, },
) { ) {
Text(text = stringResource(R.string.action_show_manga)) Text(text = stringResource(R.string.action_show_manga))