geometry update fix

This commit is contained in:
Max-Wilhelm Bruker 2011-03-09 15:32:56 +01:00
parent 2711c0e9d0
commit ac46edd790
2 changed files with 13 additions and 12 deletions

View file

@ -23,7 +23,7 @@
#include <QDebug>
Player::Player(ServerInfo_User *info, int _id, bool _local, TabGame *_parent)
: QObject(_parent), shortcutsActive(false), defaultNumberTopCards(3), lastTokenDestroy(true), userInfo(new ServerInfo_User(info)), id(_id), active(false), local(_local), mirrored(false), conceded(false), dialogSemaphore(false)
: QObject(_parent), shortcutsActive(false), defaultNumberTopCards(3), lastTokenDestroy(true), userInfo(new ServerInfo_User(info)), id(_id), active(false), local(_local), mirrored(false), handVisible(false), conceded(false), dialogSemaphore(false)
{
setCacheMode(DeviceCoordinateCache);
@ -328,15 +328,14 @@ void Player::playerListActionTriggered()
void Player::rearrangeZones()
{
QPointF base = QPointF(CARD_HEIGHT + counterAreaWidth + 15, 0);
if (settingsCache->getHorizontalHand()) {
if (mirrored) {
if (hand->contentsKnown()) {
hand->setVisible(true);
handVisible = true;
hand->setPos(base);
base += QPointF(0, hand->boundingRect().height());
} else
hand->setVisible(false);
handVisible = false;
stack->setPos(base);
base += QPointF(stack->boundingRect().width(), 0);
@ -349,14 +348,14 @@ void Player::rearrangeZones()
base += QPointF(0, table->boundingRect().height());
if (hand->contentsKnown()) {
hand->setVisible(true);
handVisible = true;
hand->setPos(base);
} else
hand->setVisible(false);
handVisible = false;
}
hand->setWidth(table->getWidth() + stack->boundingRect().width());
} else {
hand->setVisible(true);
handVisible = true;
hand->setPos(base);
base += QPointF(hand->boundingRect().width(), 0);
@ -366,6 +365,7 @@ void Player::rearrangeZones()
table->setPos(base);
}
hand->setVisible(handVisible);
hand->updateOrientation();
table->reorganizeCards();
updateBoundingRect();
@ -392,7 +392,7 @@ void Player::updateBoundingRect()
prepareGeometryChange();
qreal width = CARD_HEIGHT + 15 + counterAreaWidth + stack->boundingRect().width();
if (settingsCache->getHorizontalHand()) {
qreal handHeight = hand->isVisible() ? hand->boundingRect().height() : 0;
qreal handHeight = handVisible ? hand->boundingRect().height() : 0;
bRect = QRectF(0, 0, width + table->boundingRect().width(), table->boundingRect().height() + handHeight);
} else
bRect = QRectF(0, 0, width + hand->boundingRect().width() + table->boundingRect().width(), table->boundingRect().height());

View file

@ -135,6 +135,7 @@ private:
bool active;
bool local;
bool mirrored;
bool handVisible;
bool conceded;
bool dialogSemaphore;