diff options
author | Christian Klinger | 2016-04-27 14:27:30 +0200 |
---|---|---|
committer | Christian Klinger | 2016-04-27 14:27:30 +0200 |
commit | 79c67645efe1a06cac26c844187e858b04df1088 (patch) | |
tree | a709522c02bf466bea2f340daade0ef653bde48c /src/server/mainwindow/mainwindow.cpp | |
parent | read gridSize&clientSize from config. (diff) | |
download | pvs2-79c67645efe1a06cac26c844187e858b04df1088.tar.gz pvs2-79c67645efe1a06cac26c844187e858b04df1088.tar.xz pvs2-79c67645efe1a06cac26c844187e858b04df1088.zip |
respect configured clientSize.
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r-- | src/server/mainwindow/mainwindow.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 966356a..d20b525 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -230,7 +230,11 @@ ConnectionFrame* MainWindow::createFrame() ConnectionFrame* MainWindow::createFrame(QString computerId, QPoint pxCoord, QPoint gridPosition) { // Allocate and resize - ConnectionFrame *cf = new ConnectionFrame(ui->frmRoom, getTileWidthPx(), getTileHeightPx()); + Room* room = Global::getRooms()[Global::getCurrentRoom()]; + int width = getTileWidthPx() * room->clientSize.width(); + int height = getTileHeightPx() * room->clientSize.height(); + + ConnectionFrame *cf = new ConnectionFrame(ui->frmRoom, width, height); cf->setComputerId(computerId); cf->setCurrentPosition(pxCoord); cf->setGridPosition(gridPosition); @@ -493,6 +497,8 @@ void MainWindow::changeEvent(QEvent* e) */ void MainWindow::resizeEvent(QResizeEvent* e) { + Room* room = Global::getRooms()[Global::getCurrentRoom()]; + QSize& clientSize = room->clientSize; // Resize all connection windows if (ui->frmRoom->size().width() < 100 || ui->frmRoom->size().height() < 100 || _tilesX <= 0 || _tilesY <= 0) return; @@ -504,7 +510,7 @@ void MainWindow::resizeEvent(QResizeEvent* e) int newPosY = (*it)->getGridPosition().y() * getTileHeightPx(); QPoint newPos(newPosX, newPosY); - (*it)->setSize(getTileWidthPx(), getTileHeightPx()); + (*it)->setSize(getTileWidthPx() * clientSize.width(), getTileHeightPx() * clientSize.height()); (*it)->move(newPos); } |