From 21963d35cc641d3ffceeaa74c57da51b9cf5da62 Mon Sep 17 00:00:00 2001 From: tapframe <85391825+tapframe@users.noreply.github.com> Date: Mon, 13 Apr 2026 19:21:17 +0530 Subject: [PATCH] fix: adjust poster card shape for homecollectionrow --- .../home/components/HomeCollectionRowSection.kt | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/home/components/HomeCollectionRowSection.kt b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/home/components/HomeCollectionRowSection.kt index 0a1fa3cb..2c3121aa 100644 --- a/composeApp/src/commonMain/kotlin/com/nuvio/app/features/home/components/HomeCollectionRowSection.kt +++ b/composeApp/src/commonMain/kotlin/com/nuvio/app/features/home/components/HomeCollectionRowSection.kt @@ -1,6 +1,5 @@ package com.nuvio.app.features.home.components -import androidx.compose.foundation.clickable import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Box import androidx.compose.foundation.layout.BoxWithConstraints @@ -26,6 +25,7 @@ import androidx.compose.ui.unit.dp import androidx.compose.ui.unit.sp import com.nuvio.app.core.ui.NuvioShelfSection import com.nuvio.app.core.ui.PosterLandscapeAspectRatio +import com.nuvio.app.core.ui.landscapePosterWidth import com.nuvio.app.core.ui.posterCardClickable import com.nuvio.app.core.ui.rememberPosterCardStyleUiState import com.nuvio.app.features.collection.Collection @@ -89,21 +89,22 @@ private fun CollectionFolderCard( onClick: (() -> Unit)? = null, ) { val posterCardStyle = rememberPosterCardStyleUiState() - val shape = folder.posterShape + val isLandscapeMode = posterCardStyle.catalogLandscapeModeEnabled + val shape = if (isLandscapeMode) PosterShape.Landscape else folder.posterShape val cardWidth: Dp val aspectRatio: Float when (shape) { PosterShape.Poster -> { - cardWidth = 110.dp + cardWidth = posterCardStyle.widthDp.dp aspectRatio = 0.675f } PosterShape.Landscape -> { - cardWidth = 180.dp + cardWidth = landscapePosterWidth(posterCardStyle.widthDp) aspectRatio = PosterLandscapeAspectRatio } PosterShape.Square -> { - cardWidth = 120.dp + cardWidth = posterCardStyle.widthDp.dp aspectRatio = 1f } }