Sync command zone visibility on construction and reflow stack on height change

- Sync command zone visibility in the PlayerGraphicsItem constructor in case processPlayerInfo runs before the signal is connected.
    - Emit CommandZone::effectiveHeightChanged() when a minimized zone's height changes so the stack zone repositions.
This commit is contained in:
DawnFire42 2026-06-19 11:40:46 -04:00
parent 4c60fd2ebd
commit f74f83c5ec
No known key found for this signature in database
GPG key ID: 24BB855EE2911B33
3 changed files with 15 additions and 5 deletions

View file

@ -44,15 +44,20 @@ void CommandZone::setMinimumHeight(int height)
if (minimumHeight == height) {
return;
}
// Only meaningful while minimized, where currentHeight() depends on minimumHeight.
const qreal oldEffectiveHeight = currentHeight();
minimumHeight = height;
prepareGeometryChange();
updateClipRect();
reorganizeCards();
update();
// NOTE: Do NOT emit minimizedChanged here. The minimized STATE has not changed,
// only the minimum height constraint. Emitting here causes an infinite loop:
// rearrangeZones -> rearrangeCounters -> rearrangeTaxCounters -> setMinimumHeight
// -> minimizedChanged -> rearrangeZones (loop!)
// Do NOT emit minimizedChanged: the minimized STATE is unchanged, and that signal
// feeds rearrangeZones -> rearrangeCounters -> setMinimumHeight (infinite loop).
// effectiveHeightChanged repositions neighbouring zones and converges instead: the
// rearrange re-enters setMinimumHeight with the same height and early-returns above.
if (!qFuzzyCompare(currentHeight(), oldEffectiveHeight)) {
emit effectiveHeightChanged();
}
}
bool CommandZone::isMinimized() const