diff --git a/pokerth.pro b/pokerth.pro index 7deac8b9..4e1ef438 100755 --- a/pokerth.pro +++ b/pokerth.pro @@ -78,8 +78,8 @@ SOURCES += pokerth.cpp \ TEMPLATE = vcapp RESOURCES = src/gui/qt/deck.qrc TEMPLATE = app -DEPENDPATH += . src uics src/config src/config/tinyxml src/gui src/gui/qt src/engine src/engine/local_engine src/engine/network_engine -INCLUDEPATH += . src uics src/config src/config/tinyxml src/gui src/gui/qt src/engine src/engine/local_engine src/engine/network_engine +DEPENDPATH += . src uics src/config src/config/tinyxml src/gui src/gui/qt src/gui/qt/startsplash src/engine src/engine/local_engine src/engine/network_engine +INCLUDEPATH += . src uics src/config src/config/tinyxml src/gui src/gui/qt src/gui/qt/startsplash src/engine src/engine/local_engine src/engine/network_engine CONFIG += qt release UI_DIR = uics TARGET = bin/pokerth diff --git a/src/gui/qt/deck.qrc b/src/gui/qt/deck.qrc index d263bb0c..b78af2eb 100755 --- a/src/gui/qt/deck.qrc +++ b/src/gui/qt/deck.qrc @@ -2,6 +2,7 @@ cards/dealerbutton.png cards/logo1-140x100_neu.png + graphics/logo-140-100.png cards/mycards/0.png diff --git a/src/gui/qt/mainwindowimpl.cpp b/src/gui/qt/mainwindowimpl.cpp index b57f693b..8c7c3536 100755 --- a/src/gui/qt/mainwindowimpl.cpp +++ b/src/gui/qt/mainwindowimpl.cpp @@ -22,6 +22,7 @@ #include "newgamedialogimpl.h" #include "aboutpokerthimpl.h" #include "settingsdialogimpl.h" +#include "startsplash.h" #include "handinterface.h" #include "playerinterface.h" @@ -1380,33 +1381,33 @@ void mainWindowImpl::breakButtonClicked() { } } +void mainWindowImpl::paintStartSplash() { + + StartSplash *mySplash = new StartSplash(); + + mySplash->setGeometry(0,0,300,200); + mySplash->setWindowFlags(Qt::SplashScreen); + mySplash->show(); + +// QTimer *timer = new QTimer(this); +// connect(timer, SIGNAL(timeout()), mySplash, SLOT(/*StartSp*/lash::nextAnimationFrame())); +// timer->start(100); + +} + + void mainWindowImpl::keyPressEvent ( QKeyEvent * event ) { // cout << event->key() << endl; + if (event->key() == 16777265) { switchToolBox(); } if (event->key() == 65) { - -QWidget *myWidget = new QWidget(this, Qt::SplashScreen); - myWidget->setGeometry(100,100,100,100); -// myWidget->setMask(QRegion(3,3,40,40)); - myWidget->show(); - -// QPicture picture; - QPainter painter(this); -// painter.begin(this); // paint in picture - painter.drawEllipse(10,20, 80,70); // draw an ellipse - painter.end(); + paintStartSplash(); + } if (event->key() == 66) { - -// myWidget->hide(); - - /*QPicture picture; - QPainter painter; - painter.begin(this); // paint in picture - painter.drawEllipse(10,20, 80,70); // draw an ellipse - painter.end(); */ + } diff --git a/src/gui/qt/mainwindowimpl.h b/src/gui/qt/mainwindowimpl.h index 7ff2754d..03ca36d0 100755 --- a/src/gui/qt/mainwindowimpl.h +++ b/src/gui/qt/mainwindowimpl.h @@ -150,6 +150,7 @@ public slots: void keyPressEvent ( QKeyEvent * event ); void switchToolBox(); + void paintStartSplash(); private: diff --git a/src/gui/qt/startsplash/startsplash.cpp b/src/gui/qt/startsplash/startsplash.cpp index 6cf3eb50..7ba80cf6 100644 --- a/src/gui/qt/startsplash/startsplash.cpp +++ b/src/gui/qt/startsplash/startsplash.cpp @@ -14,6 +14,12 @@ StartSplash::StartSplash() : QWidget() { + + frameNo = 0; + + QTimer *timer = new QTimer; + connect(timer, SIGNAL(timeout()), this, SLOT(nextAnimationFrame())); + timer->start(40); } @@ -21,4 +27,27 @@ StartSplash::~StartSplash() { } +void StartSplash::nextAnimationFrame() { + + ++frameNo; + update(); + } + +void StartSplash::paintEvent(QPaintEvent * event) { + + QPainter painter(this); + + if(frameNo < 51) { + + painter.setBrush(QColor(0+frameNo,40+frameNo,6+frameNo)); + painter.drawRect(0,0,299,199); + + } + + if(frameNo >= 51) { + + painter.setBrush(QColor(51,91,57)); + painter.drawRect(0,0,299,199); + } +} diff --git a/src/gui/qt/startsplash/startsplash.h b/src/gui/qt/startsplash/startsplash.h index e1a8274e..cc6e62f5 100644 --- a/src/gui/qt/startsplash/startsplash.h +++ b/src/gui/qt/startsplash/startsplash.h @@ -12,17 +12,24 @@ #ifndef STARTSPLASH_H #define STARTSPLASH_H -#include +#include +#include -/** - @author FThauer FHammer -*/ class StartSplash : public QWidget { +Q_OBJECT public: StartSplash(); ~StartSplash(); + + int frameNo; + + void paintEvent(QPaintEvent * event); + +public slots: + + void nextAnimationFrame(); };