fix coding style
svn path=/trunk/KDE/kdelibs/; revision=1041163
This commit is contained in:
parent
6c0f314c8b
commit
28bab1f99d
@ -66,8 +66,8 @@ QAbstractAnimation* ExpandAnimation::render(QObject* parent)
|
||||
//Recreate only if needed
|
||||
QPropertyAnimation *anim = dynamic_cast<QPropertyAnimation* >(animation());
|
||||
if (!anim) {
|
||||
anim = new QPropertyAnimation(m_object, "geometry", parent);
|
||||
setAnimation(anim);
|
||||
anim = new QPropertyAnimation(m_object, "geometry", parent);
|
||||
setAnimation(anim);
|
||||
}
|
||||
anim->setEndValue(geometry);
|
||||
anim->setDuration(duration());
|
||||
|
@ -62,8 +62,8 @@ QAbstractAnimation* GrowAnimation::render(QObject* parent){
|
||||
//Recreate only if needed
|
||||
QPropertyAnimation *anim = dynamic_cast<QPropertyAnimation* >(animation());
|
||||
if (!anim) {
|
||||
anim = new QPropertyAnimation(m_object, "geometry", parent);
|
||||
setAnimation(anim);
|
||||
anim = new QPropertyAnimation(m_object, "geometry", parent);
|
||||
setAnimation(anim);
|
||||
}
|
||||
|
||||
anim->setEndValue(QRectF(
|
||||
|
@ -34,8 +34,8 @@ QAbstractAnimation* PauseAnimation::render(QObject* parent)
|
||||
//Recreate only if needed
|
||||
QPauseAnimation *anim = dynamic_cast<QPauseAnimation* >(animation());
|
||||
if (!anim) {
|
||||
anim = new QPauseAnimation(duration(), parent);
|
||||
setAnimation(anim);
|
||||
anim = new QPauseAnimation(duration(), parent);
|
||||
setAnimation(anim);
|
||||
}
|
||||
|
||||
return anim;
|
||||
|
@ -114,32 +114,32 @@ void PulseAnimation::createAnimation(qreal duration, qreal scale)
|
||||
|
||||
QParallelAnimationGroup *anim = dynamic_cast<QParallelAnimationGroup* >(animation());
|
||||
if (!anim) {
|
||||
d->pulseGeometry = new QRectF(d->under->geometry());
|
||||
QParallelAnimationGroup *group = new QParallelAnimationGroup(this);
|
||||
d->opacityAnimation = new QPropertyAnimation(d->under, "opacity");
|
||||
d->opacityAnimation->setDuration(duration);
|
||||
d->opacityAnimation->setEndValue(0);
|
||||
group->addAnimation(d->opacityAnimation);
|
||||
d->pulseGeometry = new QRectF(d->under->geometry());
|
||||
QParallelAnimationGroup *group = new QParallelAnimationGroup(this);
|
||||
d->opacityAnimation = new QPropertyAnimation(d->under, "opacity");
|
||||
d->opacityAnimation->setDuration(duration);
|
||||
d->opacityAnimation->setEndValue(0);
|
||||
group->addAnimation(d->opacityAnimation);
|
||||
|
||||
/* TODO: move this to a function */
|
||||
d->geometryAnimation = new QPropertyAnimation(d->under, "geometry");
|
||||
d->geometryAnimation->setDuration(duration);
|
||||
QRectF initial(d->under->geometry());
|
||||
qreal W = initial.width() * scale * 0.33;
|
||||
qreal H = initial.height() * scale * 0.33;
|
||||
QRectF end(initial.x() - W, initial.y() - H, initial.width() * scale,
|
||||
initial.height() * scale);
|
||||
d->geometryAnimation->setEndValue(end);
|
||||
group->addAnimation(d->geometryAnimation);
|
||||
/* TODO: move this to a function */
|
||||
d->geometryAnimation = new QPropertyAnimation(d->under, "geometry");
|
||||
d->geometryAnimation->setDuration(duration);
|
||||
QRectF initial(d->under->geometry());
|
||||
qreal W = initial.width() * scale * 0.33;
|
||||
qreal H = initial.height() * scale * 0.33;
|
||||
QRectF end(initial.x() - W, initial.y() - H, initial.width() * scale,
|
||||
initial.height() * scale);
|
||||
d->geometryAnimation->setEndValue(end);
|
||||
group->addAnimation(d->geometryAnimation);
|
||||
|
||||
d->scaleAnimation = new QPropertyAnimation(d->under, "scale");
|
||||
d->scaleAnimation->setDuration(duration);
|
||||
d->scaleAnimation->setEndValue(scale);
|
||||
/* The group takes ownership of all animations */
|
||||
group->addAnimation(d->scaleAnimation);
|
||||
d->animation = group;
|
||||
setAnimation(d->animation);
|
||||
dirty = true;
|
||||
d->scaleAnimation = new QPropertyAnimation(d->under, "scale");
|
||||
d->scaleAnimation->setDuration(duration);
|
||||
d->scaleAnimation->setEndValue(scale);
|
||||
/* The group takes ownership of all animations */
|
||||
group->addAnimation(d->scaleAnimation);
|
||||
d->animation = group;
|
||||
setAnimation(d->animation);
|
||||
dirty = true;
|
||||
|
||||
} else {
|
||||
|
||||
@ -166,9 +166,9 @@ void PulseAnimation::createAnimation(qreal duration, qreal scale)
|
||||
}
|
||||
|
||||
if (dirty) {
|
||||
//This makes sure that if there is *not* a shadow widget, the
|
||||
//parent widget will still remain visible
|
||||
connect(d->animation, SIGNAL(finished()), this, SLOT(resetPulser()));
|
||||
//This makes sure that if there is *not* a shadow widget, the
|
||||
//parent widget will still remain visible
|
||||
connect(d->animation, SIGNAL(finished()), this, SLOT(resetPulser()));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -145,8 +145,8 @@ QPropertyAnimation *RotationAnimation::render(QObject *parent)
|
||||
|
||||
QPropertyAnimation *rotationAnimation = dynamic_cast<QPropertyAnimation* >(animation());
|
||||
if (!rotationAnimation) {
|
||||
rotationAnimation = new QPropertyAnimation(d->rotation, "angle", m_object);
|
||||
setAnimation(rotationAnimation);
|
||||
rotationAnimation = new QPropertyAnimation(d->rotation, "angle", m_object);
|
||||
setAnimation(rotationAnimation);
|
||||
}
|
||||
|
||||
rotationAnimation->setStartValue(0);
|
||||
|
@ -98,19 +98,19 @@ QAbstractAnimation *RotationStackedAnimation::render(QObject *parent)
|
||||
QSequentialAnimationGroup *groupAnim = dynamic_cast<QSequentialAnimationGroup* >(animation());
|
||||
if (!groupAnim) {
|
||||
|
||||
groupAnim = new QSequentialAnimationGroup(parent);
|
||||
frontAnim = new QPropertyAnimation(d->frontRotation, "angle", groupAnim);
|
||||
backAnim = new QPropertyAnimation(d->backRotation, "angle", groupAnim);
|
||||
setAnimation(groupAnim);
|
||||
dirty = true;
|
||||
groupAnim = new QSequentialAnimationGroup(parent);
|
||||
frontAnim = new QPropertyAnimation(d->frontRotation, "angle", groupAnim);
|
||||
backAnim = new QPropertyAnimation(d->backRotation, "angle", groupAnim);
|
||||
setAnimation(groupAnim);
|
||||
dirty = true;
|
||||
} else {
|
||||
if (groupAnim->animationCount() == 2) {
|
||||
frontAnim = dynamic_cast<QPropertyAnimation* >(groupAnim->animationAt(0));
|
||||
backAnim = dynamic_cast<QPropertyAnimation* >(groupAnim->animationAt(1));
|
||||
} else {
|
||||
kDebug() << "_ Where are my little animations? Duh!";
|
||||
return groupAnim;
|
||||
}
|
||||
if (groupAnim->animationCount() == 2) {
|
||||
frontAnim = dynamic_cast<QPropertyAnimation* >(groupAnim->animationAt(0));
|
||||
backAnim = dynamic_cast<QPropertyAnimation* >(groupAnim->animationAt(1));
|
||||
} else {
|
||||
kDebug() << "_ Where are my little animations? Duh!";
|
||||
return groupAnim;
|
||||
}
|
||||
}
|
||||
|
||||
const qreal widgetFrontWidth = widgets.first->size().width();
|
||||
@ -155,9 +155,9 @@ QAbstractAnimation *RotationStackedAnimation::render(QObject *parent)
|
||||
backAnim->setDuration(duration()/2);
|
||||
|
||||
if (dirty) {
|
||||
connect(frontAnim, SIGNAL(finished()), this, SLOT(rotateBackWidget()));
|
||||
groupAnim->addAnimation(frontAnim);
|
||||
groupAnim->addAnimation(backAnim);
|
||||
connect(frontAnim, SIGNAL(finished()), this, SLOT(rotateBackWidget()));
|
||||
groupAnim->addAnimation(frontAnim);
|
||||
groupAnim->addAnimation(backAnim);
|
||||
}
|
||||
|
||||
return groupAnim;
|
||||
|
@ -42,21 +42,22 @@ QAbstractAnimation* SlideAnimation::render(QObject* parent)
|
||||
qreal newX = x;
|
||||
qreal newY = y;
|
||||
|
||||
kDebug()<<direction( );
|
||||
switch (direction()) {
|
||||
case MoveUp:
|
||||
newY = y - distance();
|
||||
newY -= distance();
|
||||
break;
|
||||
|
||||
case MoveRight:
|
||||
newX = x + distance();
|
||||
newX += distance();
|
||||
break;
|
||||
|
||||
case MoveDown:
|
||||
newY = y + distance();
|
||||
newY += distance();
|
||||
break;
|
||||
|
||||
case MoveLeft:
|
||||
newX = x - distance();
|
||||
newX -= distance();
|
||||
break;
|
||||
|
||||
case MoveUpRight:
|
||||
@ -81,11 +82,11 @@ QAbstractAnimation* SlideAnimation::render(QObject* parent)
|
||||
//QObject::connect(anim, SIGNAL(finished()), anim, SLOT(deleteLater()));
|
||||
|
||||
if (dirty) {
|
||||
if (isVisible()) {
|
||||
QObject::connect(anim, SIGNAL(finished()), m_object, SLOT(show()));
|
||||
} else {
|
||||
if (isVisible()) {
|
||||
QObject::connect(anim, SIGNAL(finished()), m_object, SLOT(show()));
|
||||
} else {
|
||||
QObject::connect(anim, SIGNAL(finished()), m_object, SLOT(hide()));
|
||||
}
|
||||
}
|
||||
}
|
||||
return anim;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user