* hide() items on completed dissapear

* emit signals on anim completion
* note that the slide anim needs to be rewritten

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=693277
This commit is contained in:
Aaron J. Seigo 2007-07-27 16:34:01 +00:00
parent e94eba8882
commit 6f850a1f66
2 changed files with 11 additions and 5 deletions

View File

@ -111,16 +111,17 @@ void Animator::frameAppear(qreal frame, QGraphicsItem* item, const QRegion& draw
void Animator::slideIn(qreal progress, QGraphicsItem *item, const QPoint &destination)
{
kDebug()<<k_funcinfo<<endl;
//FIXME: rewrite
Q_UNUSED(progress);
item->translate(-destination.x(),-destination.y());
item->translate(-destination.x(), -destination.y());
}
void Animator::slideOut(qreal progress, QGraphicsItem *item, const QPoint &destination)
{
//FIXME: rewrite
Q_UNUSED(progress);
//kDebug()<<k_funcinfo<<endl;
item->translate(destination.x(),destination.y());
item->translate(destination.x(), destination.y());
}
void Animator::renderBackground(QImage& background)

View File

@ -95,6 +95,9 @@ class Phase::Private
break;
case Phase::Disappear:
animator->disappear(amount, state->item);
if (amount >= 1) {
state->item->hide();
}
break;
case Phase::Activate:
animator->activate(amount, state->item);
@ -104,14 +107,15 @@ class Phase::Private
break;
}
}
void performMovement(qreal amount, const MovementState* state)
void performMovement(qreal amount, const MovementState* state)
{
switch (state->movement) {
case Phase::SlideIn:
animator->slideIn(amount, state->item, state->destination);
break;
case Phase::SlideOut:
animator->slideOut(amount, state->item,state->destination);
animator->slideOut(amount, state->item, state->destination);
break;
}
}
@ -376,6 +380,7 @@ void Phase::timerEvent(QTimerEvent *event)
} else {
d->performAnimation(1, state);
d->animatedItems.erase(d->animatedItems.find(state->item));
emit animationComplete(state->item, state->animation);
delete state;
}
} else {