feat(splash): random silly loading GIF (wow-lite-wallet tradition)
The wallet-open splash now shows a random loader from a bundled set (13 curated GIFs from wownero/wow-lite-wallet, ~2.2MB) instead of the static key icon — auto-discovered from :/silly, aspect-scaled to 56px, falls back to the key pixmap if none present. Assets by a friend (same Wownero family).
@@ -34,7 +34,7 @@ if (CHECK_UPDATES)
|
||||
add_subdirectory(openpgp)
|
||||
endif()
|
||||
|
||||
qt_add_resources(RESOURCES assets.qrc assets_tor.qrc assets_wownerod.qrc assets_docs.qrc mining.qrc)
|
||||
qt_add_resources(RESOURCES assets.qrc assets_tor.qrc assets_wownerod.qrc assets_docs.qrc mining.qrc silly.qrc)
|
||||
|
||||
# Compile source files (.h/.cpp)
|
||||
file(GLOB SOURCE_FILES
|
||||
|
||||
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 293 KiB |
|
After Width: | Height: | Size: 170 KiB |
|
After Width: | Height: | Size: 265 KiB |
|
After Width: | Height: | Size: 228 KiB |
|
After Width: | Height: | Size: 311 KiB |
|
After Width: | Height: | Size: 175 KiB |
|
After Width: | Height: | Size: 28 KiB |
|
After Width: | Height: | Size: 62 KiB |
|
After Width: | Height: | Size: 144 KiB |
|
After Width: | Height: | Size: 136 KiB |
|
After Width: | Height: | Size: 248 KiB |
|
After Width: | Height: | Size: 24 KiB |
@@ -4,6 +4,10 @@
|
||||
#include "SplashDialog.h"
|
||||
#include "ui_SplashDialog.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QMovie>
|
||||
#include <QRandomGenerator>
|
||||
|
||||
#include "utils/Icons.h"
|
||||
|
||||
SplashDialog::SplashDialog(QWidget *parent)
|
||||
@@ -14,8 +18,25 @@ SplashDialog::SplashDialog(QWidget *parent)
|
||||
|
||||
this->setWindowIcon(icons()->icon("appicon/64x64"));
|
||||
|
||||
QPixmap pixmap = QPixmap(":/assets/images/key.png");
|
||||
ui->icon->setPixmap(pixmap.scaledToWidth(32, Qt::SmoothTransformation));
|
||||
// wowlet: a random silly loading GIF (wow-lite-wallet tradition) instead of
|
||||
// a static key icon. Auto-discovers whatever loaders are bundled under
|
||||
// :/silly so the set can grow without touching this code; falls back to the
|
||||
// key pixmap if none are present.
|
||||
const QStringList loaders = QDir(":/silly").entryList(QStringList() << "*.gif", QDir::Files);
|
||||
if (!loaders.isEmpty()) {
|
||||
const QString pick = ":/silly/" + loaders.at(QRandomGenerator::global()->bounded(loaders.size()));
|
||||
auto *movie = new QMovie(pick, QByteArray(), this);
|
||||
movie->jumpToFrame(0);
|
||||
const QSize frame = movie->currentImage().size();
|
||||
const int h = 56;
|
||||
if (frame.height() > 0)
|
||||
movie->setScaledSize(QSize(frame.width() * h / frame.height(), h));
|
||||
ui->icon->setMovie(movie);
|
||||
movie->start();
|
||||
} else {
|
||||
QPixmap pixmap = QPixmap(":/assets/images/key.png");
|
||||
ui->icon->setPixmap(pixmap.scaledToWidth(32, Qt::SmoothTransformation));
|
||||
}
|
||||
|
||||
this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
|
||||
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource prefix="/">
|
||||
<file alias="silly/l11.gif">assets/images/silly/l11.gif</file>
|
||||
<file alias="silly/l12.gif">assets/images/silly/l12.gif</file>
|
||||
<file alias="silly/l19.gif">assets/images/silly/l19.gif</file>
|
||||
<file alias="silly/l1.gif">assets/images/silly/l1.gif</file>
|
||||
<file alias="silly/l21.gif">assets/images/silly/l21.gif</file>
|
||||
<file alias="silly/l22.gif">assets/images/silly/l22.gif</file>
|
||||
<file alias="silly/l26.gif">assets/images/silly/l26.gif</file>
|
||||
<file alias="silly/l27.gif">assets/images/silly/l27.gif</file>
|
||||
<file alias="silly/l3.gif">assets/images/silly/l3.gif</file>
|
||||
<file alias="silly/l5.gif">assets/images/silly/l5.gif</file>
|
||||
<file alias="silly/l6.gif">assets/images/silly/l6.gif</file>
|
||||
<file alias="silly/l7.gif">assets/images/silly/l7.gif</file>
|
||||
<file alias="silly/loading.gif">assets/images/silly/loading.gif</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||