summaryrefslogtreecommitdiffstats
path: root/src/server/mainwindow/mainwindow.cpp
diff options
context:
space:
mode:
authorChristian Klinger2016-05-23 11:29:04 +0200
committerChristian Klinger2016-05-23 11:29:04 +0200
commit20a7893699251e22493920e49ea813e45a588abd (patch)
tree97e3e740648b302d1670da5a5a679517909f8bec /src/server/mainwindow/mainwindow.cpp
parentRender SVG image on loading with screen resolution. (diff)
downloadpvs2-20a7893699251e22493920e49ea813e45a588abd.tar.gz
pvs2-20a7893699251e22493920e49ea813e45a588abd.tar.xz
pvs2-20a7893699251e22493920e49ea813e45a588abd.zip
move back connectionframes that went out of the window due to resizing.
Diffstat (limited to 'src/server/mainwindow/mainwindow.cpp')
-rw-r--r--src/server/mainwindow/mainwindow.cpp10
1 files changed, 10 insertions, 0 deletions
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<ConnectionFrame*>::iterator it = _clientFrames.begin(); it != _clientFrames.end(); ++it)