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.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user