diff options
author | Robert C. Helling <helling@atdotde.de> | 2018-01-13 16:37:19 +0100 |
---|---|---|
committer | Lubomir I. Ivanov <neolit123@gmail.com> | 2018-01-13 19:13:14 +0100 |
commit | de49f2484f108b725ad239a66352a42c63fb2070 (patch) | |
tree | 1304f092d2d6d176ea95e6db8b5da2def290e4c3 /desktop-widgets/mainwindow.cpp | |
parent | b4d37e8eeb061b19b8d506cd74f860bf1de2c01d (diff) | |
download | subsurface-de49f2484f108b725ad239a66352a42c63fb2070.tar.gz |
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>
Diffstat (limited to 'desktop-widgets/mainwindow.cpp')
-rw-r--r-- | desktop-widgets/mainwindow.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/desktop-widgets/mainwindow.cpp b/desktop-widgets/mainwindow.cpp index 5cf3dc27f..26c67a261 100644 --- a/desktop-widgets/mainwindow.cpp +++ b/desktop-widgets/mainwindow.cpp @@ -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 } |