* actually start the timeline (durr!)
* open up the possiblity to change the CurveShape depending on the effect svn path=/trunk/KDE/kdebase/workspace/lib/plasma/; revision=673396
This commit is contained in:
parent
3b8fc737e4
commit
2360b4b210
@ -102,6 +102,7 @@ void Phase::animate(QGraphicsItem* item, Animation animation)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int frames = 0;
|
int frames = 0;
|
||||||
|
QTimeLine::CurveShape curveShape = QTimeLine::EaseInOutCurve;
|
||||||
switch (animation) {
|
switch (animation) {
|
||||||
case Appear:
|
case Appear:
|
||||||
frames = d->animator->appearFrames();
|
frames = d->animator->appearFrames();
|
||||||
@ -123,6 +124,7 @@ void Phase::animate(QGraphicsItem* item, Animation animation)
|
|||||||
|
|
||||||
QTimeLine* timeLine = new QTimeLine(333, this);
|
QTimeLine* timeLine = new QTimeLine(333, this);
|
||||||
timeLine->setFrameRange(0, frames / 3.0);
|
timeLine->setFrameRange(0, frames / 3.0);
|
||||||
|
timeLine->setCurveShape(curveShape);
|
||||||
|
|
||||||
AnimationState state;
|
AnimationState state;
|
||||||
state.item = item;
|
state.item = item;
|
||||||
@ -131,6 +133,7 @@ void Phase::animate(QGraphicsItem* item, Animation animation)
|
|||||||
d->theAnimated[item] = timeLine;
|
d->theAnimated[item] = timeLine;
|
||||||
connect(timeLine, SIGNAL(frameChanged(int)), this, SLOT(advanceFrame(int)));
|
connect(timeLine, SIGNAL(frameChanged(int)), this, SLOT(advanceFrame(int)));
|
||||||
connect(timeLine, SIGNAL(finished()), this, SLOT(animationComplete()));
|
connect(timeLine, SIGNAL(finished()), this, SLOT(animationComplete()));
|
||||||
|
timeLine->start();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Phase::advanceFrame(int frame)
|
void Phase::advanceFrame(int frame)
|
||||||
@ -138,12 +141,14 @@ void Phase::advanceFrame(int frame)
|
|||||||
QTimeLine* timeLine = dynamic_cast<QTimeLine*>(sender());
|
QTimeLine* timeLine = dynamic_cast<QTimeLine*>(sender());
|
||||||
|
|
||||||
if (!timeLine) {
|
if (!timeLine) {
|
||||||
|
kDebug() << "Phase::advanceFrame found no timeLine!" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QMap<QTimeLine*, AnimationState>::iterator it = d->animations.find(timeLine);
|
QMap<QTimeLine*, AnimationState>::iterator it = d->animations.find(timeLine);
|
||||||
|
|
||||||
if (it == d->animations.end()) {
|
if (it == d->animations.end()) {
|
||||||
|
kDebug() << "Phase::advanceFrame found no entry in animations!" << endl;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user