From f9754f4f587449f6d9c3a31a99b5c39269d561ac Mon Sep 17 00:00:00 2001 From: arkon Date: Mon, 11 Sep 2023 18:39:36 -0400 Subject: [PATCH] Fix cut off labels in reader sheet toggles --- .../reader/OrientationModeSelectDialog.kt | 2 +- .../presentation/reader/ReadingModeSelectDialog.kt | 2 +- .../core/components/material/IconToggleButton.kt | 14 +++++++++++--- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/app/src/main/java/eu/kanade/presentation/reader/OrientationModeSelectDialog.kt b/app/src/main/java/eu/kanade/presentation/reader/OrientationModeSelectDialog.kt index f88a012c0e..0fbe079a93 100644 --- a/app/src/main/java/eu/kanade/presentation/reader/OrientationModeSelectDialog.kt +++ b/app/src/main/java/eu/kanade/presentation/reader/OrientationModeSelectDialog.kt @@ -45,7 +45,7 @@ fun OrientationModeSelectDialog( }, modifier = Modifier.fillMaxWidth(), imageVector = ImageVector.vectorResource(mode.iconRes), - label = stringResource(stringRes), + title = stringResource(stringRes), ) } } diff --git a/app/src/main/java/eu/kanade/presentation/reader/ReadingModeSelectDialog.kt b/app/src/main/java/eu/kanade/presentation/reader/ReadingModeSelectDialog.kt index 376d3795cd..cb11d9950e 100644 --- a/app/src/main/java/eu/kanade/presentation/reader/ReadingModeSelectDialog.kt +++ b/app/src/main/java/eu/kanade/presentation/reader/ReadingModeSelectDialog.kt @@ -46,7 +46,7 @@ fun ReadingModeSelectDialog( }, modifier = Modifier.fillMaxWidth(), imageVector = ImageVector.vectorResource(mode.iconRes), - label = stringResource(stringRes), + title = stringResource(stringRes), ) } } diff --git a/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/IconToggleButton.kt b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/IconToggleButton.kt index 27c6590a70..2abcc4b398 100644 --- a/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/IconToggleButton.kt +++ b/presentation-core/src/main/java/tachiyomi/presentation/core/components/material/IconToggleButton.kt @@ -3,6 +3,7 @@ package tachiyomi.presentation.core.components.material import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Row import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height import androidx.compose.foundation.layout.padding import androidx.compose.material3.FilledIconToggleButton import androidx.compose.material3.Icon @@ -12,6 +13,8 @@ import androidx.compose.runtime.Composable import androidx.compose.ui.Alignment import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.vector.ImageVector +import androidx.compose.ui.text.style.TextOverflow +import androidx.compose.ui.unit.dp @Composable fun IconToggleButton( @@ -19,12 +22,13 @@ fun IconToggleButton( onCheckedChange: (Boolean) -> Unit, modifier: Modifier = Modifier, imageVector: ImageVector, - label: String, + title: String, ) { FilledIconToggleButton( checked = checked, onCheckedChange = onCheckedChange, - modifier = modifier, + modifier = modifier + .height(48.dp), ) { Row( horizontalArrangement = Arrangement.spacedBy(MaterialTheme.padding.small), @@ -38,7 +42,11 @@ fun IconToggleButton( contentDescription = null, ) - Text(label) + Text( + text = title, + maxLines = 2, + overflow = TextOverflow.Ellipsis, + ) } } }