mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 01:23:57 -07:00
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:
parent
4c60fd2ebd
commit
f74f83c5ec
3 changed files with 15 additions and 5 deletions
|
|
@ -66,6 +66,8 @@ PlayerGraphicsItem::PlayerGraphicsItem(PlayerLogic *_player) : player(_player)
|
|||
connect(player, &PlayerLogic::addViewCustomZoneActionToCustomZoneMenu, this,
|
||||
&PlayerGraphicsItem::onCustomZoneAdded);
|
||||
connect(player, &PlayerLogic::commandZoneSupportChanged, this, &PlayerGraphicsItem::setCommandZoneVisible);
|
||||
// Sync initial state in case processPlayerInfo already ran before this connection.
|
||||
setCommandZoneVisible(player->hasServerCommandZone());
|
||||
|
||||
playerMenu->setMenusForGraphicItems();
|
||||
|
||||
|
|
@ -131,6 +133,7 @@ void PlayerGraphicsItem::initializeZones()
|
|||
commandZoneGraphicsItem->setZValue(ZValues::COMMAND_ZONE);
|
||||
commandZoneGraphicsItem->setVisible(false);
|
||||
connect(commandZoneGraphicsItem, &CommandZone::minimizedChanged, this, &PlayerGraphicsItem::rearrangeZones);
|
||||
connect(commandZoneGraphicsItem, &CommandZone::effectiveHeightChanged, this, &PlayerGraphicsItem::rearrangeZones);
|
||||
|
||||
connect(handZoneGraphicsItem->getLogic(), &HandZoneLogic::cardCountChanged, handCounter,
|
||||
&HandCounter::updateNumber);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue