fix(ui): in modalità Spartito lo spartito assorbe lo spazio residuo
Gli Spacer elastici che centravano il contenuto collassano in FULL (si dividevano lo spazio col pentagramma lasciandogli un terzo); il viewport si aggancia a righi interi per non tagliare un rigo a metà. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
860274aa41
commit
f48a327a33
2 files changed
+14
-2
No files matched your search
@@ -70,9 +70,13 @@ fun StaffFullView(
|
||||
}
|
||||
|
||||
// Con un vincolo di altezza dal contenitore (es. weight in Pratica) il
|
||||
// viewport si adatta alla finestra; altrimenti vale il tetto di default
|
||||
// viewport si adatta alla finestra; altrimenti vale il tetto di default.
|
||||
// L'altezza si aggancia a righi interi per non tagliare un rigo a metà.
|
||||
val heightBound = if (this.maxHeight != Dp.Infinity) this.maxHeight else maxVisibleHeight
|
||||
val viewportHeightDp = if (totalHeightDp < heightBound) totalHeightDp else heightBound
|
||||
val stride = systemHeightDp + systemGapDp
|
||||
val wholeSystems = ((heightBound + systemGapDp) / stride).toInt().coerceAtLeast(1)
|
||||
val snappedBound = stride * wholeSystems - systemGapDp
|
||||
val viewportHeightDp = if (totalHeightDp < snappedBound) totalHeightDp else snappedBound
|
||||
Box(
|
||||
modifier = Modifier
|
||||
.fillMaxWidth()
|
||||
|
||||
@@ -274,7 +274,11 @@ fun PracticeScreen(
|
||||
)
|
||||
}
|
||||
|
||||
if (currentMode == StaffMode.FULL) {
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
} else {
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
}
|
||||
|
||||
// Staff display based on mode
|
||||
val staffBgMod = if (lightStaff) {
|
||||
@@ -390,11 +394,15 @@ fun PracticeScreen(
|
||||
}
|
||||
}
|
||||
|
||||
if (currentMode == StaffMode.FULL) {
|
||||
Spacer(modifier = Modifier.height(8.dp))
|
||||
} else {
|
||||
Spacer(modifier = Modifier.weight(1f))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
Reference in new issue
Block a user