From 72f2ef3617daa0473899e20f2d39509846d50f22 Mon Sep 17 00:00:00 2001 From: LoRd_MuldeR Date: Sat, 30 Nov 2013 13:09:36 +0100 Subject: [PATCH] Also adjust the *width* of the about dialog. --- src/Dialog_About.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/src/Dialog_About.cpp b/src/Dialog_About.cpp index 44f893c1..5ee44753 100644 --- a/src/Dialog_About.cpp +++ b/src/Dialog_About.cpp @@ -414,15 +414,25 @@ void AboutDialog::geometryUpdated(void) void AboutDialog::adjustSize(void) { - int maximumHeight = QApplication::desktop()->availableGeometry().height(); + const int maxH = QApplication::desktop()->availableGeometry().height(); + const int maxW = QApplication::desktop()->availableGeometry().width(); - int delta = ui->infoScrollArea->widget()->height() - ui->infoScrollArea->viewport()->height(); - if(delta > 0) + const int deltaH = ui->infoScrollArea->widget()->height() - ui->infoScrollArea->viewport()->height(); + const int deltaW = ui->infoScrollArea->widget()->width() - ui->infoScrollArea->viewport()->width(); + + if(deltaH > 0) { - this->resize(this->width(), qMin(this->height() + delta, maximumHeight)); - this->move(this->x(), this->y() - (delta/2)); + this->resize(this->width(), qMin(this->height() + deltaH, maxH)); + this->move(this->x(), this->y() - (deltaH / 2)); this->setMinimumHeight(qMax(this->minimumHeight(), this->height())); } + + if(deltaW > 0) + { + this->resize(qMin(this->width() + deltaW, maxW), this->height()); + this->move(this->x() - (deltaW / 2), this->y()); + this->setMinimumWidth(qMax(this->minimumWidth(), this->width())); + } } ////////////////////////////////////////////////////////////