Expand done now.

svn path=/trunk/KDE/kdelibs/; revision=1036746
This commit is contained in:
Adenilson Cavalcanti Da Silva 2009-10-17 18:00:19 +00:00
parent 298998fa71
commit 526c8cf98f
2 changed files with 10 additions and 13 deletions

View File

@ -18,19 +18,19 @@
*/
#include "expand.h"
#include "private/animationprivate_p.h"
#include <QRect>
#include <kdebug.h>
namespace Plasma
{
ExpandAnimation::ExpandAnimation(AnimationDirection direction, qreal distance)
: m_direction(direction),
m_distance(distance)
{
AnimationPrivate *obj = getAnimationPrivate();
obj->animDirection = direction;
obj->animDistance = distance;
}
QAbstractAnimation* ExpandAnimation::render(QObject* parent){
@ -38,24 +38,25 @@ QAbstractAnimation* ExpandAnimation::render(QObject* parent){
//get current geometry values
QGraphicsWidget *m_object = getAnimatedObject();
QRectF geometry = m_object->geometry();
AnimationPrivate *obj = getAnimationPrivate();
//compute new geometry values
switch (m_direction){
switch (obj->animDirection){
case MoveUp:
geometry.setTop(geometry.y() - m_distance);
geometry.setTop(geometry.y() - obj->animDistance);
break;
case MoveRight:
geometry.setRight(geometry.x() + geometry.width() - 1 + m_distance);
geometry.setRight(geometry.x() + geometry.width() - 1 + obj->animDistance);
break;
case MoveDown:
geometry.setBottom(geometry.y() + geometry.height() - 1 + m_distance);
geometry.setBottom(geometry.y() + geometry.height() - 1 + obj->animDistance);
break;
case MoveLeft:
geometry.setLeft(geometry.x() - m_distance);
geometry.setLeft(geometry.x() - obj->animDistance);
break;
case MoveUpRight:

View File

@ -48,10 +48,6 @@ public:
protected:
virtual QAbstractAnimation* render(QObject* parent = 0);
private:
AnimationDirection m_direction;
qreal m_distance;
};
}