Resize progress bar width to fit all text

At least on Mac with larger font sizes part of the label
text of the git access progress bar is cut off (even though
it should automatically resize). This patch adds explicit
resize.

Fixes #1041

Signed-off-by: Robert C. Helling <helling@atdotde.de>
This commit is contained in:
Robert C. Helling 2018-01-13 16:37:19 +01:00 committed by Lubomir I. Ivanov
parent b4d37e8eeb
commit de49f2484f

View file

@ -78,6 +78,8 @@ extern "C" int updateProgress(const char *text)
if (progressDialog) {
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
}