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:
parent
e2e0745748
commit
234171e753
@ -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)
|
||||
|
2
phase.h
2
phase.h
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user