From 526c8cf98fe57af8e6040f5085ef15b268ed9ce8 Mon Sep 17 00:00:00 2001 From: Adenilson Cavalcanti Da Silva Date: Sat, 17 Oct 2009 18:00:19 +0000 Subject: [PATCH] Expand done now. svn path=/trunk/KDE/kdelibs/; revision=1036746 --- animations/expand.cpp | 19 ++++++++++--------- animations/expand.h | 4 ---- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/animations/expand.cpp b/animations/expand.cpp index 894994d17..dca14c12d 100644 --- a/animations/expand.cpp +++ b/animations/expand.cpp @@ -18,19 +18,19 @@ */ #include "expand.h" +#include "private/animationprivate_p.h" #include - #include 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: diff --git a/animations/expand.h b/animations/expand.h index 6d8e85fe5..bc65a30a0 100644 --- a/animations/expand.h +++ b/animations/expand.h @@ -48,10 +48,6 @@ public: protected: virtual QAbstractAnimation* render(QObject* parent = 0); -private: - AnimationDirection m_direction; - qreal m_distance; - }; }