Browse Source

Ellipsize long titles

Fixes #8075
arkon 2 years ago
parent
commit
9859b38f32

+ 2 - 0
app/src/main/java/eu/kanade/presentation/library/components/LibraryComfortableGrid.kt

@@ -9,6 +9,7 @@ import androidx.compose.material3.MaterialTheme
 import androidx.compose.material3.Text
 import androidx.compose.runtime.Composable
 import androidx.compose.ui.Modifier
+import androidx.compose.ui.text.style.TextOverflow
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import eu.kanade.domain.manga.model.MangaCover
@@ -94,6 +95,7 @@ fun MangaGridComfortableText(
         text = text,
         fontSize = 12.sp,
         maxLines = 2,
+        overflow = TextOverflow.Ellipsis,
         style = MaterialTheme.typography.titleSmall,
     )
 }

+ 2 - 0
app/src/main/java/eu/kanade/presentation/library/components/LibraryCompactGrid.kt

@@ -19,6 +19,7 @@ import androidx.compose.ui.draw.clip
 import androidx.compose.ui.graphics.Brush
 import androidx.compose.ui.graphics.Color
 import androidx.compose.ui.graphics.Shadow
+import androidx.compose.ui.text.style.TextOverflow
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.unit.sp
 import eu.kanade.tachiyomi.data.database.models.LibraryManga
@@ -114,6 +115,7 @@ fun BoxScope.MangaGridCompactText(
         color = Color.White,
         fontSize = 12.sp,
         maxLines = 2,
+        overflow = TextOverflow.Ellipsis,
         style = MaterialTheme.typography.titleSmall.copy(
             shadow = Shadow(
                 color = Color.Black,

+ 2 - 0
app/src/main/java/eu/kanade/presentation/library/components/LibraryList.kt

@@ -14,6 +14,7 @@ import androidx.compose.runtime.Composable
 import androidx.compose.ui.Alignment
 import androidx.compose.ui.Modifier
 import androidx.compose.ui.res.stringResource
+import androidx.compose.ui.text.style.TextOverflow
 import androidx.compose.ui.unit.dp
 import androidx.compose.ui.zIndex
 import eu.kanade.domain.manga.model.MangaCover
@@ -179,6 +180,7 @@ fun RowScope.MangaListItemContent(
             .padding(horizontal = horizontalPadding)
             .weight(1f),
         maxLines = 2,
+        overflow = TextOverflow.Ellipsis,
         style = MaterialTheme.typography.bodyMedium,
     )
 }