gfx changes for startup on android
This commit is contained in:
@@ -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() ) );
|
||||
|
||||
Reference in New Issue
Block a user