Browse Source

Dark mode has a dark animation

pull/169/head
Duke Leto 4 years ago
parent
commit
153c430aa7
  1. 1
      application.qrc
  2. BIN
      res/silentdragon-animated-dark.gif
  3. BIN
      res/silentdragon-animated.gif
  4. 18
      src/connection.cpp
  5. 16
      src/rpc.cpp
  6. 17
      src/sendtab.cpp

1
application.qrc

@ -12,6 +12,7 @@
<file>res/zcashdlogo.gif</file>
<file>res/logobig.gif</file>
<file>res/silentdragon-animated.gif</file>
<file>res/silentdragon-animated-dark.gif</file>
</qresource>
<qresource prefix="/translations">
<file>res/silentdragon_bg.qm</file>

BIN
res/silentdragon-animated-dark.gif

Binary file not shown.

After

Width:  |  Height:  |  Size: 406 KiB

BIN
res/silentdragon-animated.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.8 MiB

After

Width:  |  Height:  |  Size: 406 KiB

18
src/connection.cpp

@ -19,11 +19,19 @@ ConnectionLoader::ConnectionLoader(MainWindow* main, RPC* rpc) {
d->setWindowFlags(d->windowFlags() & ~(Qt::WindowCloseButtonHint | Qt::WindowContextHelpButtonHint));
connD = new Ui_ConnectionDialog();
connD->setupUi(d);
QMovie *movie = new QMovie(":/img/res/silentdragon-animated.gif");
//QPixmap logo(":/img/res/silentdragon-animated.gif");
connD->topIcon->setMovie(movie);
movie->start();
//main->logger->write("set topIcon");
QMovie *movie1 = new QMovie(":/img/res/silentdragon-animated.gif");;
QMovie *movie2 = new QMovie(":/img/res/silentdragon-animated-dark.gif");;
auto theme = Settings::getInstance()->get_theme_name();
if (theme == "dark") {
movie2->setScaledSize(QSize(512,512));
connD->topIcon->setMovie(movie2);
movie2->start();
} else {
movie1->setScaledSize(QSize(512,512));
connD->topIcon->setMovie(movie1);
movie1->start();
}
main->logger->write("set animation");
}
ConnectionLoader::~ConnectionLoader() {

16
src/rpc.cpp

@ -1218,9 +1218,19 @@ void RPC::shutdownZcashd() {
Ui_ConnectionDialog connD;
connD.setupUi(&d);
//connD.topIcon->setBasePixmap(QIcon(":/icons/res/icon.ico").pixmap(256, 256));
QMovie *movie = new QMovie(":/img/res/silentdragon-animated.gif");
connD.topIcon->setMovie(movie);
movie->start();
QMovie *movie1 = new QMovie(":/img/res/silentdragon-animated.gif");;
QMovie *movie2 = new QMovie(":/img/res/silentdragon-animated-dark.gif");;
auto theme = Settings::getInstance()->get_theme_name();
if (theme == "dark") {
movie2->setScaledSize(QSize(512,512));
connD.topIcon->setMovie(movie2);
movie2->start();
} else {
movie1->setScaledSize(QSize(512,512));
connD.topIcon->setMovie(movie1);
movie1->start();
}
connD.status->setText(QObject::tr("Please enhance your calm and wait for SilentDragon to exit"));
connD.statusDetail->setText(QObject::tr("Waiting for hushd to exit, y'all"));

17
src/sendtab.cpp

@ -707,14 +707,23 @@ void MainWindow::sendButton() {
// Show a dialog to confirm the Tx
if (confirmTx(tx)) {
// Create a new Dialog to show that we are computing/sending the Tx
// Create a new Dialog to show that we are computing/sending the Tx
auto d = new QDialog(this);
auto connD = new Ui_ConnectionDialog();
connD->setupUi(d);
QMovie *movie = new QMovie(":/img/res/silentdragon-animated.gif");
connD->topIcon->setMovie(movie);
movie->start();
QMovie *movie1 = new QMovie(":/img/res/silentdragon-animated.gif");;
QMovie *movie2 = new QMovie(":/img/res/silentdragon-animated-dark.gif");;
auto theme = Settings::getInstance()->get_theme_name();
if (theme == "dark") {
movie2->setScaledSize(QSize(512,512));
connD->topIcon->setMovie(movie2);
movie2->start();
} else {
movie1->setScaledSize(QSize(512,512));
connD->topIcon->setMovie(movie1);
movie1->start();
}
//connD->topIcon->setBasePixmap(logo.scaled(256, 256, Qt::KeepAspectRatio, Qt::SmoothTransformation));

Loading…
Cancel
Save