[Player] Pull handVisible out of player_info and let graphics_item just determine this on its own. (#6911)

Took 12 minutes


Took 15 seconds

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-05-19 12:10:19 +02:00 committed by GitHub
parent 7a5b2e9f0e
commit af2f888293
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 9 additions and 20 deletions

View file

@ -158,11 +158,11 @@ void PlayerGraphicsItem::rearrangeZones()
if (SettingsCache::instance().getHorizontalHand()) {
if (mirrored) {
if (player->getHandZone()->contentsKnown()) {
player->getPlayerInfo()->setHandVisible(true);
handVisible = true;
handZoneGraphicsItem->setPos(base);
base += QPointF(0, handZoneGraphicsItem->boundingRect().height());
} else {
player->getPlayerInfo()->setHandVisible(false);
handVisible = false;
}
stackZoneGraphicsItem->setPos(base);
@ -176,16 +176,16 @@ void PlayerGraphicsItem::rearrangeZones()
base += QPointF(0, tableZoneGraphicsItem->boundingRect().height());
if (player->getHandZone()->contentsKnown()) {
player->getPlayerInfo()->setHandVisible(true);
handVisible = true;
handZoneGraphicsItem->setPos(base);
} else {
player->getPlayerInfo()->setHandVisible(false);
handVisible = false;
}
}
handZoneGraphicsItem->setWidth(tableZoneGraphicsItem->getWidth() +
stackZoneGraphicsItem->boundingRect().width());
} else {
player->getPlayerInfo()->setHandVisible(true);
handVisible = true;
handZoneGraphicsItem->setPos(base);
base += QPointF(handZoneGraphicsItem->boundingRect().width(), 0);
@ -195,7 +195,7 @@ void PlayerGraphicsItem::rearrangeZones()
tableZoneGraphicsItem->setPos(base);
}
handZoneGraphicsItem->setVisible(player->getPlayerInfo()->getHandVisible());
handZoneGraphicsItem->setVisible(handVisible);
handZoneGraphicsItem->updateOrientation();
tableZoneGraphicsItem->reorganizeCards();
updateBoundingRect();
@ -207,8 +207,7 @@ void PlayerGraphicsItem::updateBoundingRect()
prepareGeometryChange();
qreal width = CardDimensions::HEIGHT_F + 15 + counterAreaWidth + stackZoneGraphicsItem->boundingRect().width();
if (SettingsCache::instance().getHorizontalHand()) {
qreal handHeight =
player->getPlayerInfo()->getHandVisible() ? handZoneGraphicsItem->boundingRect().height() : 0;
qreal handHeight = handVisible ? handZoneGraphicsItem->boundingRect().height() : 0;
bRect = QRectF(0, 0, width + tableZoneGraphicsItem->boundingRect().width(),
tableZoneGraphicsItem->boundingRect().height() + handHeight);
} else {