From b9318a9ab1a04e19eb2c5877449e12be91f5bdeb Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sat, 16 Jun 2018 12:54:12 +0900 Subject: 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 --- desktop-widgets/mainwindow.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'desktop-widgets') 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 } -- cgit v1.2.3-70-g09d2