From 0f3313da4d88100d3797e359a12d0bef6a34e68f Mon Sep 17 00:00:00 2001 From: Hasinjato Date: Fri, 18 Sep 2026 16:27:12 +0300 Subject: [PATCH] Adjust partition columnCount zoom +/- buttons and add margins --- .../kotlin/mg/dot/feufaro/solfa/TimeUnitObject.kt | 6 +++--- .../kotlin/mg/dot/feufaro/viewmodel/SharedScreenModel.kt | 4 +--- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/composeApp/src/commonMain/kotlin/mg/dot/feufaro/solfa/TimeUnitObject.kt b/composeApp/src/commonMain/kotlin/mg/dot/feufaro/solfa/TimeUnitObject.kt index 11bdbbf..06efe11 100644 --- a/composeApp/src/commonMain/kotlin/mg/dot/feufaro/solfa/TimeUnitObject.kt +++ b/composeApp/src/commonMain/kotlin/mg/dot/feufaro/solfa/TimeUnitObject.kt @@ -496,7 +496,7 @@ fun bestTUOWidth( } } - maxWidth = max + maxWidth = max + 5.dp //marge isReady = true // println("=== [DEBUG TUO] Largeur retenue (maxWidth finale) : $maxWidth ===") } @@ -669,7 +669,7 @@ fun LazyVerticalGridTUO( val gridCount by sharedScreenModel.gridCount.collectAsState() - var gridColumnCount: Int = remember(gridWidthDp, tuoWidthMeasure.isReady, tuoWidthMeasure.width, multiple) { + var baseGridColumnCount: Int = remember(gridWidthDp, tuoWidthMeasure.isReady, tuoWidthMeasure.width, multiple) { if (!tuoWidthMeasure.isReady || gridWidthDp <= 0.dp || tuoWidthMeasure.width <= 0.dp) { return@remember multiple } @@ -690,7 +690,7 @@ fun LazyVerticalGridTUO( finalCols } - gridColumnCount += gridCount + val gridColumnCount = (baseGridColumnCount + gridCount).coerceAtLeast(multiple) val flowRowSize: Float = 0.98f / gridColumnCount val currentStanza = viewModel.stanza diff --git a/composeApp/src/commonMain/kotlin/mg/dot/feufaro/viewmodel/SharedScreenModel.kt b/composeApp/src/commonMain/kotlin/mg/dot/feufaro/viewmodel/SharedScreenModel.kt index 689a070..9579798 100644 --- a/composeApp/src/commonMain/kotlin/mg/dot/feufaro/viewmodel/SharedScreenModel.kt +++ b/composeApp/src/commonMain/kotlin/mg/dot/feufaro/viewmodel/SharedScreenModel.kt @@ -525,9 +525,7 @@ class SharedScreenModel(private val fileRepository: FileRepository) : ScreenMode _gridCount.value += nbGrid } fun descGridCount(nbGrid: Int) { - if(_gridCount.value > 0) { - _gridCount.value -= nbGrid - } + _gridCount.value -= nbGrid } fun resetGridCount() { _gridCount.value = 0