aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoingui.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-01-13 14:16:48 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2014-01-13 14:45:23 +0100
commitf10b2d70d09c2e9f5c14ba5e3673c5fb31aa9468 (patch)
tree72b26aeba1b3bb47636ffe8e2ece85fc0c44c214 /src/qt/bitcoingui.cpp
parenta7973c9b6b6c72bca2e6e90aed08553bf708938d (diff)
qt: use series of pngs for spinner
Use a series of .png frames for the spinner instead of a .mng. `mng` is an obscure image format and is not built by default into Qt5. This appears to improve the crispness of the spinner as well. Does not noticably increase the size (still ~27k) and the code is not more complicated either.
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r--src/qt/bitcoingui.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 22c41a6201..c29595050b 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -39,7 +39,6 @@
#include <QMenuBar>
#include <QMessageBox>
#include <QMimeData>
-#include <QMovie>
#include <QProgressBar>
#include <QSettings>
#include <QStackedWidget>
@@ -68,7 +67,8 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) :
trayIcon(0),
notificator(0),
rpcConsole(0),
- prevBlocks(0)
+ prevBlocks(0),
+ spinnerFrame(0)
{
GUIUtil::restoreWindowGeometry("nWindow", QSize(850, 550), this);
@@ -187,8 +187,6 @@ BitcoinGUI::BitcoinGUI(bool fIsTestnet, QWidget *parent) :
statusBar()->addWidget(progressBar);
statusBar()->addPermanentWidget(frameBlocks);
- syncIconMovie = new QMovie(":/movies/update_spinner", "mng", this);
-
connect(openRPCConsoleAction, SIGNAL(triggered()), rpcConsole, SLOT(show()));
// prevents an oben debug window from becoming stuck/unusable on client shutdown
@@ -684,9 +682,13 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
progressBar->setVisible(true);
tooltip = tr("Catching up...") + QString("<br>") + tooltip;
- labelBlocksIcon->setMovie(syncIconMovie);
if(count != prevBlocks)
- syncIconMovie->jumpToNextFrame();
+ {
+ labelBlocksIcon->setPixmap(QIcon(QString(
+ ":/movies/spinner-%1").arg(spinnerFrame, 3, 10, QChar('0')))
+ .pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
+ spinnerFrame = (spinnerFrame + 1) % SPINNER_FRAMES;
+ }
prevBlocks = count;
#ifdef ENABLE_WALLET