From 20a7893699251e22493920e49ea813e45a588abd Mon Sep 17 00:00:00 2001 From: Christian Klinger Date: Mon, 23 May 2016 11:29:04 +0200 Subject: move back connectionframes that went out of the window due to resizing. --- src/server/mainwindow/mainwindow.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/server/mainwindow/mainwindow.cpp') diff --git a/src/server/mainwindow/mainwindow.cpp b/src/server/mainwindow/mainwindow.cpp index 7b95982..e6efb1c 100644 --- a/src/server/mainwindow/mainwindow.cpp +++ b/src/server/mainwindow/mainwindow.cpp @@ -563,6 +563,7 @@ AspectStatus checkAspectRatio(const QSize& frameSize, const QSize& gridSize) { return GRID_OK; } + /***************************************************************************//** * Resize event. * @param e @@ -588,6 +589,15 @@ void MainWindow::resizeEvent(QResizeEvent* e) this->_tilesX = newGridSize.width(); this->_tilesY = newGridSize.height(); + /* Bring back frame that are now out of the screen */ + for (auto it = _clientFrames.begin(); it != _clientFrames.end(); ++it) { + const QPoint gp = (*it)->getGridPosition(); + if ( gp.x() > _tilesX || gp.y() > _tilesY ) { + qDebug() << "bring frame back"; + placeFrameInFreeSlot(*it, (*it)->getCurrentPosition()); + } + } + /* Resize all connection windows */ for (QList::iterator it = _clientFrames.begin(); it != _clientFrames.end(); ++it) -- cgit v1.2.3-55-g7522