예제 #1
0
// titleAddText needs to be const char* for tr()
NetworkStyle::NetworkStyle(const QString &appName, const int iconColorHueShift, const int iconColorSaturationReduction, const char *titleAddText):
    appName(appName),
    titleAddText(qApp->translate("SplashScreen", titleAddText))
{
    // Allow for separate UI settings for testnets
    QApplication::setApplicationName(appName);
    // Make sure settings migrated properly
    GUIUtil::migrateQtSettings();
    // Grab theme from settings
    QString theme = GUIUtil::getThemeName();
    // load pixmap
    QPixmap appIconPixmap(":/icons/bitcoin");
    QPixmap splashImagePixmap(":/images/" + theme + "/splash");

    if(iconColorHueShift != 0 && iconColorSaturationReduction != 0)
    {
        // generate QImage from QPixmap
        QImage appIconImg = appIconPixmap.toImage();
        QImage splashImageImg = splashImagePixmap.toImage();

        rotateColors(appIconImg, iconColorHueShift, iconColorSaturationReduction);
        rotateColors(splashImageImg, iconColorHueShift, iconColorSaturationReduction);

        //convert back to QPixmap
#if QT_VERSION >= 0x040700
        appIconPixmap.convertFromImage(appIconImg);
        splashImagePixmap.convertFromImage(splashImageImg);
#else
        appIconPixmap = QPixmap::fromImage(appIconImg);
        splashImagePixmap = QPixmap::fromImage(splashImageImg);
#endif
    }

    appIcon             = QIcon(appIconPixmap);
    trayAndWindowIcon   = QIcon(appIconPixmap.scaled(QSize(256,256)));
    splashImage         = splashImagePixmap;
}
예제 #2
0
////////////////////////////////////////////////////////////////////////////////
// Rotate through color wheel once and fade to dark (useful in Sucess situations)
void LED::startupSuccess(){

	int redVal = 255;

	rotateColors(1);


	// Fade the currently ON RED to dark
  	for(int i = 255; i > 0; i--){
  		redVal -= 1;

  		analogWrite(_redPin, redVal);
      	// analogWrite(_greenPin, rgbColour[1]);
      	// analogWrite(_bluePin, rgbColour[2]);

 	    delay(1);
  	}	
}