diff --git a/shared/src/commonMain/kotlin/com/notemusicali/ui/components/StaffFullView.kt b/shared/src/commonMain/kotlin/com/notemusicali/ui/components/StaffFullView.kt index 287ff1d..bfeddf1 100644 --- a/shared/src/commonMain/kotlin/com/notemusicali/ui/components/StaffFullView.kt +++ b/shared/src/commonMain/kotlin/com/notemusicali/ui/components/StaffFullView.kt @@ -69,7 +69,10 @@ fun StaffFullView( scrollState.animateScrollTo(targetY) } - val viewportHeightDp = if (totalHeightDp < maxVisibleHeight) totalHeightDp else maxVisibleHeight + // Con un vincolo di altezza dal contenitore (es. weight in Pratica) il + // viewport si adatta alla finestra; altrimenti vale il tetto di default + val heightBound = if (this.maxHeight != Dp.Infinity) this.maxHeight else maxVisibleHeight + val viewportHeightDp = if (totalHeightDp < heightBound) totalHeightDp else heightBound Box( modifier = Modifier .fillMaxWidth() diff --git a/shared/src/commonMain/kotlin/com/notemusicali/ui/practice/PracticeScreen.kt b/shared/src/commonMain/kotlin/com/notemusicali/ui/practice/PracticeScreen.kt index 9d5d282..0104bc0 100644 --- a/shared/src/commonMain/kotlin/com/notemusicali/ui/practice/PracticeScreen.kt +++ b/shared/src/commonMain/kotlin/com/notemusicali/ui/practice/PracticeScreen.kt @@ -310,7 +310,8 @@ fun PracticeScreen( StaffFullView( notes = state.sequence.notes, currentIndex = state.currentIndex, - modifier = staffBgMod, + // Lo spartito si prende lo spazio residuo: cresce con la finestra + modifier = Modifier.weight(1f, fill = false).then(staffBgMod), lightTheme = lightStaff, beats = state.sequence.beats, beatType = state.sequence.beatType,