aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoingui.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-08-24 14:47:54 +0200
committerLuke Dashjr <luke-jr+git@utopios.org>2012-08-26 22:13:34 +0000
commitbfe7cc638d1f6a11a030730130262e49eb6e7940 (patch)
treed4435bcfbe98bc06cf88a73a2df3571ec24d9181 /src/qt/bitcoingui.cpp
parent52153a6e08df63ff19dd40b9119c6c010b1b1796 (diff)
downloadbitcoin-bfe7cc638d1f6a11a030730130262e49eb6e7940.tar.xz
Override progress bar on platforms with segmented progress bars
Windows & WindowsXP style have a problem with displaying the block progress. Add a custom stylesheet as workaround, but only when one of those renderers is active, otherwise leave the theme alone (issue #1071).
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r--src/qt/bitcoingui.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index f8e7517431..f444f3a154 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -52,6 +52,7 @@
#include <QDragEnterEvent>
#include <QUrl>
+#include <QStyle>
#include <iostream>
@@ -141,6 +142,15 @@ BitcoinGUI::BitcoinGUI(QWidget *parent):
progressBar->setToolTip(tr("Block chain synchronization in progress"));
progressBar->setVisible(false);
+ // Override style sheet for progress bar for styles that have a segmented progress bar,
+ // as they make the text unreadable (workaround for issue #1071)
+ // See https://qt-project.org/doc/qt-4.8/gallery.html
+ QString curStyle = qApp->style()->metaObject()->className();
+ if(curStyle == "QWindowsStyle" || curStyle == "QWindowsXPStyle")
+ {
+ progressBar->setStyleSheet("QProgressBar { background-color: #e8e8e8; border: 1px solid grey; border-radius: 7px; padding: 1px; text-align: center; } QProgressBar::chunk { background: QLinearGradient(x1: 0, y1: 0, x2: 1, y2: 0, stop: 0 #FF8000, stop: 1 orange); border-radius: 7px; margin: 0px; }");
+ }
+
statusBar()->addWidget(progressBarLabel);
statusBar()->addWidget(progressBar);
statusBar()->addPermanentWidget(frameBlocks);