From bf700bb3f905942f41eadb80ee15e911dd8a9d90 Mon Sep 17 00:00:00 2001 From: Johann Latocha Date: Tue, 8 Mar 2011 18:14:52 +0100 Subject: [pvsmgrtouch] * don't resize thumbnails on window resize --- src/gui/connectionFrame.cpp | 31 +++++-------------------------- src/gui/connectionFrame.h | 1 - src/gui/mainWindow.cpp | 39 --------------------------------------- 3 files changed, 5 insertions(+), 66 deletions(-) diff --git a/src/gui/connectionFrame.cpp b/src/gui/connectionFrame.cpp index 4211a50..32e20f7 100644 --- a/src/gui/connectionFrame.cpp +++ b/src/gui/connectionFrame.cpp @@ -443,32 +443,11 @@ void ConnectionFrame::mouseMoveEvent(QMouseEvent *event) void ConnectionFrame::paintCloseUp(int w, int h) { - - - if (!_frame->image().isNull()) - { - /*this->setFixedWidth(w); - _conFrameTaskbar->setMaximumWidth(w); - resize(w, h);*/ - resizeComponent(w, h); - setMaximumSize(w,h); - resize(w, h); - } - else - { - std::cout << "pixel is NULL" << std::endl; - } - -} - -void ConnectionFrame::resizeComponent(int w, int h) -{ - int th = (h*_conFrameTaskbar->width())/w; - int uh = (h*_ip->width())/w; - //_conFrameTaskbar->setMaximumSize(w, th); - //_conFrameTaskbar->resize(w, th); - _ip->setMaximumSize(w, uh); - _ip->resize(w,uh); + if (!_frame->image().isNull()) + { + //move(0,0); + resize(w, h); + } } void ConnectionFrame::setSource() diff --git a/src/gui/connectionFrame.h b/src/gui/connectionFrame.h index 84f8549..a0334bc 100644 --- a/src/gui/connectionFrame.h +++ b/src/gui/connectionFrame.h @@ -118,7 +118,6 @@ public: void setFrameRate(int newRate); bool isClientOnline; void paintCloseUp(int w, int h); - void resizeComponent(int w, int h); void setSource(); void setTarget(); void setUnproject(); diff --git a/src/gui/mainWindow.cpp b/src/gui/mainWindow.cpp index b4dd17c..4eae44e 100644 --- a/src/gui/mainWindow.cpp +++ b/src/gui/mainWindow.cpp @@ -645,47 +645,8 @@ void MainWindow::changeEvent(QEvent *e) */ void MainWindow::resizeEvent(QResizeEvent *event) { - if (bgimage == true) - { repaintbackgroundpicture(); // repaint the backgroundpicture scaled to the window size - } - - if (_firstResize == 3) - { - QSize oldSize = event->oldSize(); - _initW = ui->widget->width(); - _initH = ui->widget->height(); - _firstResize++; - } - std::list* selectedClients = - MainWindow::getConnectionList()->getSelectedClients(); - if (is_closeup && selectedClients->size() == 1) - { - PVSClient* pvsClient = - PVSConnectionManager::getManager()->getClientFromIp( - selectedClients->front().toStdString().c_str()); - pvsClient->getConnectionFrame()->paintCloseUp(ui->widget->width(), - ui->widget->height()); - } - else if (!is_closeup && _firstResize > 3) - { - int ratio_w = (ui->widget->width() * 100) / _initW; - int ratio_h = (ui->widget->height() * 100) / _initH; -foreach (ConnectionFrame* cf, getConnectionWindow()->getFrameList()) - { - /*int margin = ui->widget->style()->pixelMetric(QStyle::PM_DefaultTopLevelMargin); - int x = ui->widget->width() - margin; - int y = ui->widget->height() - margin; - updatePos(cf, x, y);*/ - int w = (cf->init_w * ratio_w) / 100; - int h = (cf->init_h * ratio_h) / 100; - cf->paintCloseUp(w,h); - } -} - -if (_firstResize < 3) -_firstResize++; } void MainWindow::updatePos(ConnectionFrame* cf, int x, int y) -- cgit v1.2.3-55-g7522