From c55893d1dde40601481e57f681b7c7f8a944807b Mon Sep 17 00:00:00 2001 From: doitux Date: Mon, 29 Jan 2007 23:57:11 +0000 Subject: [PATCH] --- src/gui/qt/cards/mycardspixmaplabel.cpp | 33 ++++++++++++++++++++++--- src/gui/qt/cards/mycardspixmaplabel.h | 7 ++++-- 2 files changed, 35 insertions(+), 5 deletions(-) diff --git a/src/gui/qt/cards/mycardspixmaplabel.cpp b/src/gui/qt/cards/mycardspixmaplabel.cpp index 37b6fc2b..c7bb8fb1 100644 --- a/src/gui/qt/cards/mycardspixmaplabel.cpp +++ b/src/gui/qt/cards/mycardspixmaplabel.cpp @@ -22,7 +22,7 @@ MyCardsPixmapLabel::MyCardsPixmapLabel(QFrame* parent) isFlipside = FALSE; - timer = new QTimer; + fadeOutTimer = new QTimer; connect(timer, SIGNAL(timeout()), this, SLOT(nextFadeOutFrame())); } @@ -41,7 +41,7 @@ void MyCardsPixmapLabel::startFadeOut(int speed) { if(speed != 11) { fadeOutAction = TRUE; frameOpacity = 0.0; - timer->start(40); + fadeOutTimer->start(40); } } @@ -54,12 +54,39 @@ void MyCardsPixmapLabel::nextFadeOutFrame() { update(); } else { - timer->stop(); + fadeOutTimer->stop(); fadeOutAction = FALSE; } } +void MyCardsPixmapLabel::startFlipCards(int speed) { + +// if(speed <= 4) { opacityRaiseIntervall = 0.01; } +// if(speed > 4 && speed <= 7) { opacityRaiseIntervall = 0.02; } +// if(speed > 7 && speed <= 10) { opacityRaiseIntervall = 0.04; } +// +// if(speed != 11) { +// fadeOutAction = TRUE; +// frameOpacity = 0.0; +// timer->start(40); +// } + +} + +void MyCardsPixmapLabel::nextFlipCardsFrame() { + +// if (frameOpacity < 0.65) { +// frameOpacity += opacityRaiseIntervall; +// update(); +// } +// else { +// timer->stop(); +// fadeOutAction = FALSE; +// } + +} + void MyCardsPixmapLabel::setPixmap(const QPixmap &pic, const bool flipside) { QLabel::setPixmap(pic); diff --git a/src/gui/qt/cards/mycardspixmaplabel.h b/src/gui/qt/cards/mycardspixmaplabel.h index 5b132674..9706ec48 100644 --- a/src/gui/qt/cards/mycardspixmaplabel.h +++ b/src/gui/qt/cards/mycardspixmaplabel.h @@ -29,6 +29,7 @@ public: bool getIsFlipside() const{ return isFlipside;} void startFadeOut(int); + void startFlipCards(int); void paintEvent(QPaintEvent * event); @@ -37,13 +38,15 @@ public slots: void setPixmap ( const QPixmap &, const bool ); void nextFadeOutFrame(); + void nextFlipCardsFrame(); private: qreal frameOpacity; qreal opacityRaiseIntervall; - QTimer *timer; - + QTimer *fadeOutTimer; + QTimer *flipCardsTimer; + bool isFlipside; bool fadeOutAction; };