gfx changes for startup on android
|
Before Width: | Height: | Size: 396 KiB After Width: | Height: | Size: 396 KiB |
|
Before Width: | Height: | Size: 3.7 MiB After Width: | Height: | Size: 3.7 MiB |
|
Before Width: | Height: | Size: 376 KiB After Width: | Height: | Size: 376 KiB |
|
After Width: | Height: | Size: 251 KiB |
|
Before Width: | Height: | Size: 3.4 MiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 13 KiB |
@@ -361,8 +361,8 @@
|
|||||||
<file>android-data/gfx/gui/misc/background_gamelist.png</file>
|
<file>android-data/gfx/gui/misc/background_gamelist.png</file>
|
||||||
<file>android-data/gfx/gui/misc/fileopen16.png</file>
|
<file>android-data/gfx/gui/misc/fileopen16.png</file>
|
||||||
<file>android-data/gfx/gui/misc/rating.png</file>
|
<file>android-data/gfx/gui/misc/rating.png</file>
|
||||||
<file>android-data/gfx/gui/misc/startwindowbg_mobile.png</file>
|
<file>android-data/gfx/gui/misc/startwindowbg10_mobile.png</file>
|
||||||
<file>android-data/gfx/gui/misc/welcomepokerth_mobile.png</file>
|
<file>android-data/gfx/gui/misc/welcomepokerth10_mobile.png</file>
|
||||||
<file>android-data/gfx/gui/misc/windowicon.png</file>
|
<file>android-data/gfx/gui/misc/windowicon.png</file>
|
||||||
<file>android-data/fonts/DejaVuSans-Bold.ttf</file>
|
<file>android-data/fonts/DejaVuSans-Bold.ttf</file>
|
||||||
<file>android-data/fonts/n019003l.pfb</file>
|
<file>android-data/fonts/n019003l.pfb</file>
|
||||||
|
|||||||
@@ -104,62 +104,56 @@ startWindowImpl::startWindowImpl(ConfigFile *c, Log *l)
|
|||||||
QDesktopWidget dw;
|
QDesktopWidget dw;
|
||||||
int screenWidth = dw.screenGeometry().width();
|
int screenWidth = dw.screenGeometry().width();
|
||||||
int screenHeight = dw.screenGeometry().height();
|
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);
|
QFile customStartWindowBgFile(customStartWindowBgFileString);
|
||||||
if(customStartWindowBgFile.exists()) {
|
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 {
|
} else {
|
||||||
QPixmap pix(":/android/android-data/gfx/gui/misc/startwindowbg_mobile.png");
|
//if custom bg file could not be found load the big origin file
|
||||||
pix = pix.scaled(screenWidth, screenHeight, Qt::IgnoreAspectRatio, Qt::SmoothTransformation);
|
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;}");
|
||||||
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;}");
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
this->showFullScreen();
|
this->showFullScreen();
|
||||||
|
|
||||||
//TODO HACK Missing QSystemScreenSaver::setScreenSaverInhibited(TRUE)
|
//TODO HACK Missing QSystemScreenSaver::setScreenSaverInhibited(TRUE)
|
||||||
#ifndef ANDROID_TEST
|
// #ifndef ANDROID_TEST
|
||||||
JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0);
|
// JavaVM *currVM = (JavaVM *)QApplication::platformNativeInterface()->nativeResourceForWidget("JavaVM", 0);
|
||||||
JNIEnv* env;
|
// JNIEnv* env;
|
||||||
if (currVM->AttachCurrentThread(&env, NULL)<0) {
|
// if (currVM->AttachCurrentThread(&env, NULL)<0) {
|
||||||
qCritical()<<"AttachCurrentThread failed";
|
// qCritical()<<"AttachCurrentThread failed";
|
||||||
} else {
|
// } else {
|
||||||
// jclass jclassApplicationClass = env->FindClass("android/view/View");
|
// // jclass jclassApplicationClass = env->FindClass("android/view/View");
|
||||||
// if (jclassApplicationClass) {
|
// // if (jclassApplicationClass) {
|
||||||
// env->SetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"KEEP_SCREEN_ON", "I"), 1);
|
// // env->SetStaticIntField(jclassApplicationClass, env->GetStaticFieldID(jclassApplicationClass,"KEEP_SCREEN_ON", "I"), 1);
|
||||||
// }
|
// // }
|
||||||
currVM->DetachCurrentThread();
|
// currVM->DetachCurrentThread();
|
||||||
}
|
// }
|
||||||
#endif
|
// #endif
|
||||||
#else
|
#else
|
||||||
// Maemo
|
// Maemo
|
||||||
this->menubar->hide();
|
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;}");
|
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
|
#endif
|
||||||
// All mobile GUI's
|
// 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;}");
|
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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #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: #505050; color: #FDC942; font-size:22px; border-width: 0px;}");
|
||||||
|
|
||||||
connect( pushButton_about, SIGNAL( clicked() ), this, SLOT( callAboutPokerthDialog() ) );
|
connect( pushButton_about, SIGNAL( clicked() ), this, SLOT( callAboutPokerthDialog() ) );
|
||||||
connect( pushButton_configure, SIGNAL( clicked() ), this, SLOT( callSettingsDialogFromStartwindow() ) );
|
connect( pushButton_configure, SIGNAL( clicked() ), this, SLOT( callSettingsDialogFromStartwindow() ) );
|
||||||
#else
|
#else
|
||||||
//Desktop
|
//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;}");
|
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;}");
|
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: #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: #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: #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: #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: #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: #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: #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: #505050; color: #FDC942; font-size:12px; border-width: 0px;}");
|
||||||
|
|
||||||
connect( actionAbout_PokerTH, SIGNAL( triggered() ), this, SLOT( callAboutPokerthDialog() ) );
|
connect( actionAbout_PokerTH, SIGNAL( triggered() ), this, SLOT( callAboutPokerthDialog() ) );
|
||||||
connect( actionConfigure_PokerTH, SIGNAL( triggered() ), this, SLOT( callSettingsDialogFromStartwindow() ) );
|
connect( actionConfigure_PokerTH, SIGNAL( triggered() ), this, SLOT( callSettingsDialogFromStartwindow() ) );
|
||||||
|
|||||||
@@ -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) }");
|
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
|
#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;
|
QDesktopWidget dw;
|
||||||
QPixmap pixmap(myAppDataPath + "gfx/gui/misc/welcomepokerth_mobile.png");
|
int screenWidth = dw.screenGeometry().width();
|
||||||
pixmap = pixmap.scaled(dw.screenGeometry().width(), dw.screenGeometry().height(), Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
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
|
#else
|
||||||
QPixmap pixmap(myAppDataPath + "gfx/gui/misc/welcomepokerth_desktop.png");
|
QPixmap pixmap(myAppDataPath + "gfx/gui/misc/welcomepokerth10_desktop.png");
|
||||||
#endif
|
#endif
|
||||||
StartSplash splash(pixmap);
|
StartSplash splash(pixmap);
|
||||||
if(!myConfig->readConfigInt("DisableSplashScreenOnStartup")) {
|
if(!myConfig->readConfigInt("DisableSplashScreenOnStartup")) {
|
||||||
|
|||||||