Fixed automatic table resize. This fixes bug #0000023.
This commit is contained in:
parent
5ec06b4b27
commit
e09060faca
3 changed files with 5 additions and 1 deletions
|
@ -66,6 +66,7 @@ void GameScene::rearrange()
|
||||||
playersRect = QRectF(0, 0, sceneWidth, sceneHeight);
|
playersRect = QRectF(0, 0, sceneWidth, sceneHeight);
|
||||||
|
|
||||||
setSceneRect(sceneRect().x(), sceneRect().y(), sceneWidth, sceneHeight);
|
setSceneRect(sceneRect().x(), sceneRect().y(), sceneWidth, sceneHeight);
|
||||||
|
processViewSizeChange(viewSize);
|
||||||
|
|
||||||
qDebug(QString("rearrange(): w=%1 h=%2").arg(sceneWidth).arg(sceneHeight).toLatin1());
|
qDebug(QString("rearrange(): w=%1 h=%2").arg(sceneWidth).arg(sceneHeight).toLatin1());
|
||||||
}
|
}
|
||||||
|
@ -108,6 +109,8 @@ void GameScene::closeMostRecentZoneView()
|
||||||
|
|
||||||
void GameScene::processViewSizeChange(const QSize &newSize)
|
void GameScene::processViewSizeChange(const QSize &newSize)
|
||||||
{
|
{
|
||||||
|
viewSize = newSize;
|
||||||
|
|
||||||
qreal newRatio = ((qreal) newSize.width()) / newSize.height();
|
qreal newRatio = ((qreal) newSize.width()) / newSize.height();
|
||||||
qreal minWidth = 0;
|
qreal minWidth = 0;
|
||||||
for (int i = 0; i < players.size(); ++i) {
|
for (int i = 0; i < players.size(); ++i) {
|
||||||
|
|
|
@ -15,6 +15,7 @@ private:
|
||||||
QList<Player *> players;
|
QList<Player *> players;
|
||||||
QRectF playersRect;
|
QRectF playersRect;
|
||||||
QList<ZoneViewWidget *> views;
|
QList<ZoneViewWidget *> views;
|
||||||
|
QSize viewSize;
|
||||||
public:
|
public:
|
||||||
GameScene(QObject *parent = 0);
|
GameScene(QObject *parent = 0);
|
||||||
void retranslateUi();
|
void retranslateUi();
|
||||||
|
|
|
@ -186,7 +186,7 @@ void TableZone::resizeToContents()
|
||||||
if (xMax < minWidth)
|
if (xMax < minWidth)
|
||||||
xMax = minWidth;
|
xMax = minWidth;
|
||||||
currentMinimumWidth = xMax + 2 * marginX + 2 * boxLineWidth;
|
currentMinimumWidth = xMax + 2 * marginX + 2 * boxLineWidth;
|
||||||
if (currentMinimumWidth > width) {
|
if (currentMinimumWidth != width) {
|
||||||
prepareGeometryChange();
|
prepareGeometryChange();
|
||||||
width = currentMinimumWidth;
|
width = currentMinimumWidth;
|
||||||
emit sizeChanged();
|
emit sizeChanged();
|
||||||
|
|
Loading…
Reference in a new issue