diff --git a/data/gfx/gui/misc/startwindowbg_desktop.png b/data/gfx/gui/misc/startwindowbg10_desktop.png similarity index 100% rename from data/gfx/gui/misc/startwindowbg_desktop.png rename to data/gfx/gui/misc/startwindowbg10_desktop.png diff --git a/data/gfx/gui/misc/startwindowbg_mobile.png b/data/gfx/gui/misc/startwindowbg10_mobile.png similarity index 100% rename from data/gfx/gui/misc/startwindowbg_mobile.png rename to data/gfx/gui/misc/startwindowbg10_mobile.png diff --git a/data/gfx/gui/misc/welcomepokerth_desktop.png b/data/gfx/gui/misc/welcomepokerth10_desktop.png similarity index 100% rename from data/gfx/gui/misc/welcomepokerth_desktop.png rename to data/gfx/gui/misc/welcomepokerth10_desktop.png diff --git a/data/gfx/gui/misc/welcomepokerth10_mobile.png b/data/gfx/gui/misc/welcomepokerth10_mobile.png new file mode 100644 index 00000000..5f0847bf Binary files /dev/null and b/data/gfx/gui/misc/welcomepokerth10_mobile.png differ diff --git a/data/gfx/gui/misc/welcomepokerth_mobile.png b/data/gfx/gui/misc/welcomepokerth_mobile.png deleted file mode 100644 index 7c258baf..00000000 Binary files a/data/gfx/gui/misc/welcomepokerth_mobile.png and /dev/null differ diff --git a/pokerth.png b/pokerth.png index b5e981b5..11b1e993 100644 Binary files a/pokerth.png and b/pokerth.png differ diff --git a/src/gui/qt/resources/logoChip3D.png b/src/gui/qt/resources/logoChip3D.png index 798fbe40..11b1e993 100644 Binary files a/src/gui/qt/resources/logoChip3D.png and b/src/gui/qt/resources/logoChip3D.png differ diff --git a/src/gui/qt/resources/pokerth_android.qrc b/src/gui/qt/resources/pokerth_android.qrc index e103c536..a1038244 100644 --- a/src/gui/qt/resources/pokerth_android.qrc +++ b/src/gui/qt/resources/pokerth_android.qrc @@ -361,8 +361,8 @@ android-data/gfx/gui/misc/background_gamelist.png android-data/gfx/gui/misc/fileopen16.png android-data/gfx/gui/misc/rating.png - android-data/gfx/gui/misc/startwindowbg_mobile.png - android-data/gfx/gui/misc/welcomepokerth_mobile.png + android-data/gfx/gui/misc/startwindowbg10_mobile.png + android-data/gfx/gui/misc/welcomepokerth10_mobile.png android-data/gfx/gui/misc/windowicon.png android-data/fonts/DejaVuSans-Bold.ttf android-data/fonts/n019003l.pfb diff --git a/src/gui/qt/startwindow/startwindowimpl.cpp b/src/gui/qt/startwindow/startwindowimpl.cpp index 5be35710..4473213a 100644 --- a/src/gui/qt/startwindow/startwindowimpl.cpp +++ b/src/gui/qt/startwindow/startwindowimpl.cpp @@ -104,62 +104,56 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l) QDesktopWidget dw; int screenWidth = dw.screenGeometry().width(); int screenHeight = dw.screenGeometry().height(); - QString customStartWindowBgFileString(UserDataDir+"/startwindowbg_"+QString::number(screenWidth)+"x"+QString::number(screenHeight)+".png"); + QString customStartWindowBgFileString(UserDataDir+"/startwindowbg10_"+QString::number(screenWidth)+"x"+QString::number(screenHeight)+".png"); QFile customStartWindowBgFile(customStartWindowBgFileString); if(customStartWindowBgFile.exists()) { - centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); + centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: top center; background-origin: content; background-repeat: no-repeat;}"); } else { - QPixmap pix(":/android/android-data/gfx/gui/misc/startwindowbg_mobile.png"); - pix = pix.scaled(screenWidth, screenHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); - if(pix.save(customStartWindowBgFileString)) { - centralwidget->setStyleSheet(".QWidget { background-image: url("+QFileInfo(customStartWindowBgFile).absoluteFilePath()+"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); - } else { - centralwidget->setStyleSheet(".QWidget { background-image: url(:/android/android-data/gfx/gui/misc/startwindowbg_mobile.png); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); - } - + //if custom bg file could not be found load the big origin file + centralwidget->setStyleSheet(".QWidget { background-image: url(:/android/android-data/gfx/gui/misc/startwindowbg10_mobile.png); background-position: top center; background-origin: content; background-repeat: no-repeat;}"); } this->showFullScreen(); //TODO HACK Missing QSystemScreenSaver::setScreenSaverInhibited(TRUE) - #ifndef ANDROID_TEST - JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0); - JNIEnv* env; - if (currVM->AttachCurrentThread(&env, NULL)<0) { - qCritical()<<"AttachCurrentThread failed"; - } else { - // jclass jclassApplicationClass = env->FindClass("android/view/View"); - // if (jclassApplicationClass) { - // env->SetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"KEEP_SCREEN_ON", "I"), 1); - // } - currVM->DetachCurrentThread(); - } - #endif +// #ifndef ANDROID_TEST +// JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0); +// JNIEnv* env; +// if (currVM->AttachCurrentThread(&env, NULL)<0) { +// qCritical()<<"AttachCurrentThread failed"; +// } else { +// // jclass jclassApplicationClass = env->FindClass("android/view/View"); +// // if (jclassApplicationClass) { +// // env->SetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"KEEP_SCREEN_ON", "I"), 1); +// // } +// currVM->DetachCurrentThread(); +// } +// #endif #else // Maemo this->menubar->hide(); centralwidget->setStyleSheet(".QWidget { background-image: url(\""+myAppDataPath+"gfx/gui/misc/startwindowbg_desktop.png\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); #endif // All mobile GUI's - pushButtonStart_Local_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #3C2F29; color: #FDC942; font-size:22px; border-width: 0px;}"); - pushButtonInternet_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #3C2F29; color: #FDC942; font-size:22px; border-width: 0px;}"); - pushButton_Create_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #3C2F29; color: #FDC942; font-size:22px; border-width: 0px;}"); - pushButton_Join_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #3C2F29; color: #FDC942; font-size:22px; border-width: 0px;}"); - pushButton_about->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #3C2F29; color: #FDC942; font-size:22px; border-width: 0px;}"); - pushButton_configure->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #3C2F29; color: #FDC942; font-size:22px; border-width: 0px;}"); - pushButton_Logs->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #3C2F29; color: #FDC942; font-size:22px; border-width: 0px;}"); + pushButtonStart_Local_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #505050; color: #FDC942; font-size:22px; border-width: 0px;}"); + pushButtonInternet_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #505050; color: #FDC942; font-size:22px; border-width: 0px;}"); + pushButton_Create_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #505050; color: #FDC942; font-size:22px; border-width: 0px;}"); + pushButton_Join_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #505050; color: #FDC942; font-size:22px; border-width: 0px;}"); + pushButton_about->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #505050; color: #FDC942; font-size:22px; border-width: 0px;}"); + pushButton_configure->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #505050; color: #FDC942; font-size:22px; border-width: 0px;}"); + pushButton_Logs->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 3px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #505050; color: #FDC942; font-size:22px; border-width: 0px;}"); connect( pushButton_about, SIGNAL( clicked() ), this, SLOT( callAboutPokerthDialog() ) ); connect( pushButton_configure, SIGNAL( clicked() ), this, SLOT( callSettingsDialogFromStartwindow() ) ); #else //Desktop - this->menubar->setStyleSheet("QMenuBar { background-color: #3C2F29; font-size:12px; border-width: 0px;} QMenuBar::item { color: #FDC942; }"); + this->menubar->setStyleSheet("QMenuBar { background-color: #505050; font-size:12px; border-width: 0px;} QMenuBar::item { color: #FDC942; }"); centralwidget->setStyleSheet(".QWidget { background-image: url(\""+myAppDataPath+"gfx/gui/misc/startwindowbg_desktop.png\"); background-position: bottom center; background-origin: content; background-repeat: no-repeat;}"); - pushButtonStart_Local_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #3C2F29; color: #FDC942; font-size:12px; border-width: 0px;}"); - pushButtonInternet_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #3C2F29; color: #FDC942; font-size:12px; border-width: 0px;}"); - pushButton_Create_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #3C2F29; color: #FDC942; font-size:12px; border-width: 0px;}"); - pushButton_Join_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #3C2F29; color: #FDC942; font-size:12px; border-width: 0px;}"); - pushButton_Logs->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #3C2F29; color: #FDC942; font-size:12px; border-width: 0px;}"); + pushButtonStart_Local_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #505050; color: #FDC942; font-size:12px; border-width: 0px;}"); + pushButtonInternet_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #505050; color: #FDC942; font-size:12px; border-width: 0px;}"); + pushButton_Create_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #505050; color: #FDC942; font-size:12px; border-width: 0px;}"); + pushButton_Join_Network_Game->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #505050; color: #FDC942; font-size:12px; border-width: 0px;}"); + pushButton_Logs->setStyleSheet("QPushButton { text-align:left; font-weight:bold; padding-left: 1px; padding-bottom: 3px; padding-top: 3px; padding-right: 3px; background-color: #505050; color: #FDC942; font-size:12px; border-width: 0px;}"); connect( actionAbout_PokerTH, SIGNAL( triggered() ), this, SLOT( callAboutPokerthDialog() ) ); connect( actionConfigure_PokerTH, SIGNAL( triggered() ), this, SLOT( callSettingsDialogFromStartwindow() ) ); diff --git a/src/pokerth.cpp b/src/pokerth.cpp index 3ce53ac5..dc3bd03e 100755 --- a/src/pokerth.cpp +++ b/src/pokerth.cpp @@ -154,11 +154,65 @@ int main( int argc, char **argv ) a.setStyleSheet(font1String + " QDialogButtonBox, QMessageBox { dialogbuttonbox-buttons-have-icons: 1; dialog-ok-icon: url(:/gfx/dialog_ok_apply.png); dialog-cancel-icon: url(:/gfx/dialog_close.png); dialog-close-icon: url(:/gfx/dialog_close.png); dialog-yes-icon: url(:/gfx/dialog_ok_apply.png); dialog-no-icon: url(:/gfx/dialog_close.png) }"); #ifdef ANDROID + //check if custom background pictures for the resolution are there. Otherwise create them! + QString UserDataDir = QString::fromUtf8(myConfig->readConfigString("UserDataDir").c_str()); QDesktopWidget dw; - QPixmap pixmap(myAppDataPath + "gfx/gui/misc/welcomepokerth_mobile.png"); - pixmap = pixmap.scaled(dw.screenGeometry().width(), dw.screenGeometry().height(), Qt::KeepAspectRatio, Qt::SmoothTransformation); + int screenWidth = dw.screenGeometry().width(); + int screenHeight = dw.screenGeometry().height(); + QString customStartWindowBgFileString(UserDataDir+"/startwindowbg10_"+QString::number(screenWidth)+"x"+QString::number(screenHeight)+".png"); + QString customWelcomePokerTHFileString(UserDataDir+"/welcomepokerth10_"+QString::number(screenWidth)+"x"+QString::number(screenHeight)+".png"); + QFile customStartWindowBgFile(customStartWindowBgFileString); + QFile customWelcomePokerTHFile(customWelcomePokerTHFileString); + + QSplashScreen preSplashFirstRun; + if(!customStartWindowBgFile.exists()) { + + //load preSplashPix to show that PokerTH is already running during first time pics calculation + QPixmap prePixBase(":/gfx/logoChip3D.png"); + QPixmap prePix(300, 200); + prePix.fill(Qt::transparent); // force alpha channel + { + QPainter painter(&prePix); + painter.drawPixmap(0, 0, prePixBase); + painter.setPen(Qt::white); + painter.drawText(10, 160, "loading ..."); + } + preSplashFirstRun.setPixmap(prePix); + preSplashFirstRun.show(); + + QPixmap pix(":/android/android-data/gfx/gui/misc/startwindowbg10_mobile.png"); + pix = pix.scaled(screenWidth, screenHeight, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); + pix.save(customStartWindowBgFileString); + } + + if(!customWelcomePokerTHFile.exists()) { + QPixmap base(customStartWindowBgFileString); + //scale overlay "have a lot of fun" at first + QPixmap overlay(":/android/android-data/gfx/gui/misc/welcomepokerth10_mobile.png"); + overlay = overlay.scaled(screenWidth, screenHeight, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); + QPixmap result(base.width(), base.height()); + result.fill(Qt::transparent); // force alpha channel + { + QPainter painter(&result); + painter.drawPixmap(0, 0, base); + painter.drawPixmap(0, 0, overlay); + } + result.save(customWelcomePokerTHFileString); + preSplashFirstRun.hide(); + } + + QPixmap pixmap; + if(customWelcomePokerTHFile.exists()) { + pixmap.load(QFileInfo(customWelcomePokerTHFile).absoluteFilePath()); + } + else { + //if custom welcome pic could not be saved locally we need to scale it on the fly + pixmap.load(":/android/android-data/gfx/gui/misc/welcomepokerth10_mobile.png"); + pixmap = pixmap.scaled(screenWidth, screenHeight, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation); + } + #else - QPixmap pixmap(myAppDataPath + "gfx/gui/misc/welcomepokerth_desktop.png"); + QPixmap pixmap(myAppDataPath + "gfx/gui/misc/welcomepokerth10_desktop.png"); #endif StartSplash splash(pixmap); if(!myConfig->readConfigInt("DisableSplashScreenOnStartup")) {