From db788d519de65fab1dd73f02cf05688714fbccb5 Mon Sep 17 00:00:00 2001 From: arkon Date: Sat, 29 Jul 2023 12:14:11 -0400 Subject: [PATCH] Avoid badly wrapped buttons in DuplicateMangaDialog Fixes #9767 --- .../manga/DuplicateMangaDialog.kt | 32 ++++++++++++------- .../browse/migration/search/MigrateDialog.kt | 2 +- 2 files changed, 21 insertions(+), 13 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/manga/DuplicateMangaDialog.kt b/app/src/main/java/eu/kanade/presentation/manga/DuplicateMangaDialog.kt index 9d2fc0577..855236499 100644 --- a/app/src/main/java/eu/kanade/presentation/manga/DuplicateMangaDialog.kt +++ b/app/src/main/java/eu/kanade/presentation/manga/DuplicateMangaDialog.kt @@ -1,6 +1,7 @@ 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.material3.AlertDialog import androidx.compose.material3.Text @@ -8,6 +9,7 @@ import androidx.compose.material3.TextButton import androidx.compose.runtime.Composable import androidx.compose.ui.Modifier import androidx.compose.ui.res.stringResource +import androidx.compose.ui.unit.dp import eu.kanade.tachiyomi.R @Composable @@ -18,15 +20,27 @@ fun DuplicateMangaDialog( ) { AlertDialog( onDismissRequest = onDismissRequest, + title = { + Text(text = stringResource(R.string.are_you_sure)) + }, + text = { + Text(text = stringResource(R.string.confirm_add_duplicate_manga)) + }, confirmButton = { - Row { - TextButton(onClick = { - onDismissRequest() - onOpenManga() - },) { + FlowRow( + horizontalArrangement = Arrangement.spacedBy(4.dp), + ) { + TextButton( + onClick = { + onDismissRequest() + onOpenManga() + }, + ) { Text(text = stringResource(R.string.action_show_manga)) } + Spacer(modifier = Modifier.weight(1f)) + TextButton(onClick = onDismissRequest) { 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)) - }, ) } diff --git a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt index 137af5eff..71e40cee7 100644 --- a/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt +++ b/app/src/main/java/eu/kanade/tachiyomi/ui/browse/migration/search/MigrateDialog.kt @@ -121,8 +121,8 @@ internal fun MigrateDialog( ) { TextButton( onClick = { - onClickTitle() onDismissRequest() + onClickTitle() }, ) { Text(text = stringResource(R.string.action_show_manga))