From f10b2d70d09c2e9f5c14ba5e3673c5fb31aa9468 Mon Sep 17 00:00:00 2001 From: "Wladimir J. van der Laan" Date: Mon, 13 Jan 2014 14:16:48 +0100 Subject: 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. --- src/qt/bitcoingui.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/qt/bitcoingui.cpp') 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 #include #include -#include #include #include #include @@ -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("
") + 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 -- cgit v1.2.3