Added the isAnimating() function to Phase. This way, applet/widgets can delay 'heavy' operations until all animations are finished to avoid stuttering animations.

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=795821
This commit is contained in:
Rob Scheepmaker 2008-04-11 14:26:07 +00:00
parent e2e0745748
commit 234171e753
2 changed files with 11 additions and 0 deletions

View File

@ -489,6 +489,15 @@ QPixmap Phase::animationResult(AnimId id)
return state->pixmap;
}
//returns true if there are animations happening.
bool Phase::isAnimating()
{
return (d->animatedItems.size() > 0 ||
d->movingItems.size() > 0 ||
d->animatedItems.size() > 0 ||
d->customAnims.size() > 0);
}
void Phase::timerEvent(QTimerEvent *event)
{
Q_UNUSED(event)

View File

@ -116,6 +116,8 @@ public:
Q_INVOKABLE void setAnimationPixmap(AnimId id, const QPixmap &pixmap);
Q_INVOKABLE QPixmap animationResult(AnimId id);
Q_INVOKABLE bool isAnimating();
Q_SIGNALS:
void animationComplete(QGraphicsItem *item, Plasma::Phase::Animation anim);
void movementComplete(QGraphicsItem *item);