move correctly the pages at the first animation

svn path=/trunk/KDE/kdelibs/; revision=1031682
This commit is contained in:
Marco Martin 2009-10-05 18:40:58 +00:00
parent c61ec3e94e
commit 0e59e70583

View File

@ -372,16 +372,19 @@ void TabBar::setCurrentIndex(int index)
QRect beforeCurrentGeom(d->oldPage->geometry().toRect()); QRect beforeCurrentGeom(d->oldPage->geometry().toRect());
beforeCurrentGeom.moveTopRight(beforeCurrentGeom.topLeft()); beforeCurrentGeom.moveTopRight(beforeCurrentGeom.topLeft());
if (index > d->currentIndex) {
d->newPage->setPos(d->oldPage->geometry().topRight());
d->newPageAnimId = Animator::self()->moveItem( d->newPageAnimId = Animator::self()->moveItem(
d->newPage, Plasma::Animator::SlideOutMovement, d->newPage, Plasma::Animator::SlideOutMovement,
d->oldPage->pos().toPoint()); d->oldPage->pos().toPoint());
if (index > d->currentIndex) {
d->newPage->setPos(d->oldPage->geometry().topRight());
d->oldPageAnimId = Animator::self()->moveItem( d->oldPageAnimId = Animator::self()->moveItem(
d->oldPage, Plasma::Animator::SlideOutMovement, d->oldPage, Plasma::Animator::SlideOutMovement,
beforeCurrentGeom.topLeft()); beforeCurrentGeom.topLeft());
} else { } else {
d->newPage->setPos(beforeCurrentGeom.topLeft()); d->newPage->setPos(beforeCurrentGeom.topLeft());
d->newPageAnimId = Animator::self()->moveItem(
d->newPage, Plasma::Animator::SlideOutMovement,
d->oldPage->pos().toPoint());
d->oldPageAnimId = Animator::self()->moveItem( d->oldPageAnimId = Animator::self()->moveItem(
d->oldPage, Plasma::Animator::SlideOutMovement, d->oldPage, Plasma::Animator::SlideOutMovement,
d->oldPage->geometry().topRight().toPoint()); d->oldPage->geometry().topRight().toPoint());