width calculation bug fix

This commit is contained in:
Max-Wilhelm Bruker 2010-11-04 00:24:25 +01:00
parent 9645d097b4
commit 315564f567

View file

@ -1404,7 +1404,7 @@ QString Player::getName() const
qreal Player::getMinimumWidth() const qreal Player::getMinimumWidth() const
{ {
qreal result = table->getMinimumWidth() + CARD_WIDTH + 5 + counterAreaWidth; qreal result = table->getMinimumWidth() + CARD_WIDTH + 5 + counterAreaWidth + stack->boundingRect().width();
if (!settingsCache->getHorizontalHand()) if (!settingsCache->getHorizontalHand())
result += hand->boundingRect().width(); result += hand->boundingRect().width();
return result; return result;
@ -1423,10 +1423,10 @@ void Player::processSceneSizeChange(const QSizeF &newSize)
// This will need to be changed if player areas are displayed side by side (e.g. 2x2 for a 4-player game) // This will need to be changed if player areas are displayed side by side (e.g. 2x2 for a 4-player game)
qreal fullPlayerWidth = newSize.width(); qreal fullPlayerWidth = newSize.width();
qreal tableWidth = fullPlayerWidth - CARD_WIDTH - 5 - counterAreaWidth; qreal tableWidth = fullPlayerWidth - CARD_WIDTH - 5 - counterAreaWidth - stack->boundingRect().width();
if (!settingsCache->getHorizontalHand()) if (!settingsCache->getHorizontalHand())
tableWidth -= hand->boundingRect().width(); tableWidth -= hand->boundingRect().width();
table->setWidth(tableWidth); table->setWidth(tableWidth);
hand->setWidth(tableWidth); hand->setWidth(tableWidth + stack->boundingRect().width());
} }