Vertical stacking behaviour fix (#7054)

The overflow function covers the necessary edge case, the minimized branch of it was an artefact of earlier builds
This commit is contained in:
DawnFire42
2026-07-27 08:00:28 -07:00
committed by GitHub
parent 688c5d2a12
commit 4bb8831531
@@ -22,13 +22,6 @@ SelectZone::ZoneLayout SelectZone::computeZoneLayout(const StackLayoutParams &pa
}
qreal effectiveOffset = params.desiredOffset;
if (params.cardCount > 1) {
qreal fitOffset;
if (params.totalHeight < params.cardHeight && params.minOffset > 0.0) {
// Zone is shorter than a card (e.g. minimized). Compress offsets so
// every card has at least minOffset pixels of its top visible.
fitOffset = (params.totalHeight - params.minOffset) / (params.cardCount - 1);
effectiveOffset = qMax(0.0, qMin(params.desiredOffset, fitOffset));
} else {
qreal reservedForBottomCard;
if (params.allowBottomOverflow) {
// Allow the bottom card to partially overflow in tight zones, scaling the
@@ -42,7 +35,7 @@ SelectZone::ZoneLayout SelectZone::computeZoneLayout(const StackLayoutParams &pa
// No overflow: reserve full card height for the bottom card
reservedForBottomCard = params.cardHeight;
}
fitOffset = (params.totalHeight - reservedForBottomCard) / (params.cardCount - 1);
qreal fitOffset = (params.totalHeight - reservedForBottomCard) / (params.cardCount - 1);
if (!params.allowBottomOverflow) {
// Constrain offset so all card tops remain within zone bounds.
@@ -57,7 +50,6 @@ SelectZone::ZoneLayout SelectZone::computeZoneLayout(const StackLayoutParams &pa
effectiveOffset = qMax(params.minOffset, effectiveOffset);
}
}
}
qreal stackHeight = (params.cardCount - 1) * effectiveOffset + params.cardHeight;
qreal start = (stackHeight <= params.totalHeight) ? (params.totalHeight - stackHeight) / 2.0 : 0.0;
return {effectiveOffset, start};