From c534ea75c25ee189d132d7c4dd3283031de7214d Mon Sep 17 00:00:00 2001 From: justinzeus Date: Thu, 5 Nov 2026 16:18:40 +0100 Subject: [PATCH] Use resolved weights for episode rating labels --- .../java/org/justinvisser/wolfskin/design/HomeRatings.kt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/wolfskin-design/src/main/java/org/justinvisser/wolfskin/design/HomeRatings.kt b/wolfskin-design/src/main/java/org/justinvisser/wolfskin/design/HomeRatings.kt index ddf19c43..ecbd7a68 100644 --- a/wolfskin-design/src/main/java/org/justinvisser/wolfskin/design/HomeRatings.kt +++ b/wolfskin-design/src/main/java/org/justinvisser/wolfskin/design/HomeRatings.kt @@ -20,7 +20,6 @@ import androidx.compose.ui.graphics.ColorMatrix import androidx.compose.ui.graphics.graphicsLayer import androidx.compose.ui.platform.LocalDensity import androidx.compose.ui.res.painterResource -import androidx.compose.ui.text.font.FontWeight import androidx.compose.ui.text.rememberTextMeasurer import androidx.compose.ui.unit.TextUnit import androidx.tv.material3.Text @@ -49,7 +48,7 @@ fun HomeRatingsRow(ratings: List, modifier: Modifier = Modifier, fon } val muted = rating.mark == "tomato" Image(painterResource(resource), null, Modifier.size(size * if (rating.mark == "imdb" || rating.mark == "tmdb") 1.8f else 1f, size).graphicsLayer { alpha = if (muted) .55f else 1f }, colorFilter = if (muted) ColorFilter.colorMatrix(ColorMatrix().apply { setToSaturation(0f) }) else null) - if (rating.episode) Text("Ep", color = C.muted, style = T.ratingPlate.copy(fontSize = fontSize, lineHeight = fontSize * 1.2f, fontWeight = FontWeight.SemiBold), maxLines = 1) + if (rating.episode) Text("Ep", color = C.muted, style = T.ratingPlate.copy(fontSize = fontSize, lineHeight = fontSize * 1.2f, fontWeight = T.label.fontWeight), maxLines = 1) Text(rating.format(), color = C.fg, style = T.ratingPlate.copy(fontSize = fontSize, lineHeight = fontSize * 1.2f, fontFeatureSettings = "tnum"), maxLines = 1, softWrap = false) } } @@ -74,7 +73,7 @@ fun HomeRatingPlate(ratings: List, visible: Boolean, modifier: Modif return entries.sumOf { rating -> val mark = em * if (rating.mark == "imdb" || rating.mark == "tmdb") 1.8f else 1f val number = measurer.measure(rating.format(locale), T.ratingPlate.copy(fontSize = size)).size.width - val episode = if (rating.episode) measurer.measure("Ep", T.ratingPlate.copy(fontSize = size, fontWeight = FontWeight.SemiBold)).size.width + em * .29f else 0f + val episode = if (rating.episode) measurer.measure("Ep", T.ratingPlate.copy(fontSize = size, fontWeight = T.label.fontWeight)).size.width + em * .29f else 0f (mark + em * .29f + number + episode).toDouble() }.toFloat() + (entries.size - 1).coerceAtLeast(0) * em * .64f }