[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/plasma/animations
From: Adenilson Cavalcanti Da Silva <cavalcantii () gmail ! com>
Date: 2009-10-17 17:46:03
Message-ID: 1255801563.567480.2287.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 1036741 by adasilva:
Converting FadeAnimation and adding some todos: we must use qreal
since it is a typedef that falls back to float/double depending
on the cpu.
M +8 -8 fade.cpp
M +1 -3 fade.h
M +1 -0 grow.h
--- trunk/KDE/kdelibs/plasma/animations/fade.cpp #1036740:1036741
@@ -18,24 +18,24 @@
*/
#include "fade.h"
+#include "private/animationprivate_p.h"
#include <QRect>
-
#include <kdebug.h>
namespace Plasma
{
FadeAnimation::FadeAnimation(double factor)
- : m_factor(factor)
{
-
- if (m_factor > 1.0){
+ AnimationPrivate *obj = getAnimationPrivate();
+ obj->animFactor = factor;
+ if (obj->animFactor > 1.0) {
kDebug() << "Opacity must be between 0 and 1.0. Reducing to 1.0.";
- m_factor = 1.0;
- } else if(m_factor < 0){
+ obj->animFactor = 1.0;
+ } else if (obj->animFactor < 0) {
kDebug() << "Opacity must be between 0 and 1.0. Increasing to 0.";
- m_factor = 0;
+ obj->animFactor = 0;
}
}
@@ -44,7 +44,7 @@
//create animation
QGraphicsWidget *m_object = getAnimatedObject();
QPropertyAnimation* anim = new QPropertyAnimation(m_object, "opacity", parent);
- anim->setEndValue(m_factor);
+ anim->setEndValue(getAnimationPrivate()->animFactor);
anim->setDuration(getDuration());
//QObject::connect(anim, SIGNAL(finished()), anim, SLOT(deleteLater()));
--- trunk/KDE/kdelibs/plasma/animations/fade.h #1036740:1036741
@@ -41,15 +41,13 @@
Q_OBJECT
public:
+ /* TODO: convert to qreal */
FadeAnimation(double factor);
virtual ~FadeAnimation(){};
protected:
virtual QAbstractAnimation* render(QObject* parent = 0);
-private:
- qreal m_factor;
-
};
}
--- trunk/KDE/kdelibs/plasma/animations/grow.h #1036740:1036741
@@ -43,6 +43,7 @@
Q_OBJECT
public:
+ /* TODO: convert to qreal */
GrowAnimation(double factor);
virtual ~GrowAnimation(){};
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic