summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2018-06-16 12:54:12 +0900
committerGravatar Dirk Hohndel <dirk@hohndel.org>2018-06-17 06:17:08 +0900
commitb9318a9ab1a04e19eb2c5877449e12be91f5bdeb (patch)
tree68353e315c2634c96fa6454d10ee6312c347336c
parent3f012f4bdbfc70cae16a40f4a22f3d635c2b0a4a (diff)
downloadsubsurface-b9318a9ab1a04e19eb2c5877449e12be91f5bdeb.tar.gz
desktop: better handling of progress dialog width
We shouldn't need to manually set it, but it appears we do. To avoid constant resizing, let's only grow it - and let's set the size before we update the text. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r--desktop-widgets/mainwindow.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp
index 3d984ab15..644c6bfe4 100644
--- a/desktop-widgets/mainwindow.cpp
+++ b/desktop-widgets/mainwindow.cpp
@@ -77,10 +77,13 @@ extern "C" int updateProgress(const char *text)
if (verbose)
qDebug() << "git storage:" << text;
if (progressDialog) {
+ // apparently we don't always get enough space to show the full label
+ // so let's manually make enough space (but don't shrink the existing size)
+ int width = QFontMetrics(qApp->font()).width(text) + 100;
+ if (width > progressDialog->width())
+ progressDialog->resize(width + 20, progressDialog->height());
progressDialog->setLabelText(text);
progressDialog->setValue(++progressCounter);
- int width = QFontMetrics(qApp->font()).width(text) + 100;
- progressDialog->resize(width, progressDialog->height());
if (progressCounter == 100)
progressCounter = 0; // yes this is silly, but we really don't know how long it will take
}