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