From 79c67645efe1a06cac26c844187e858b04df1088 Mon Sep 17 00:00:00 2001 From: Christian Klinger Date: Wed, 27 Apr 2016 14:27:30 +0200 Subject: respect configured clientSize. --- src/server/mainwindow/mainwindow.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/server/mainwindow/mainwindow.cpp') 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); } -- cgit v1.2.3-55-g7522