equal
deleted
inserted
replaced
622 PagesStack.push(ui.Pages->currentIndex()); |
622 PagesStack.push(ui.Pages->currentIndex()); |
623 |
623 |
624 OnPageShown(id, lastid); |
624 OnPageShown(id, lastid); |
625 ui.Pages->setCurrentIndex(id); |
625 ui.Pages->setCurrentIndex(id); |
626 |
626 |
627 if (id == ID_PAGE_DRAWMAP || id == ID_PAGE_GAMESTATS) |
627 |
|
628 /* if (id == ID_PAGE_DRAWMAP || id == ID_PAGE_GAMESTATS) |
628 stopAnim = true; |
629 stopAnim = true; |
|
630 This were disabled due to broken flake animations. I believe the more general problems w/ opacity that forced its disable makes blocking these |
|
631 unnecessary. |
|
632 */ |
629 |
633 |
630 #if (QT_VERSION >= 0x040600) |
634 #if (QT_VERSION >= 0x040600) |
631 if (!stopAnim) |
635 if (!stopAnim) |
632 { |
636 { |
633 /**Start animation :**/ |
637 /**Start animation :**/ |
644 int duration = config->isFrontendEffects() ? 500 : 0; |
648 int duration = config->isFrontendEffects() ? 500 : 0; |
645 |
649 |
646 //New page animation |
650 //New page animation |
647 animationNewSlide = new QPropertyAnimation(ui.Pages->widget(id), "pos"); |
651 animationNewSlide = new QPropertyAnimation(ui.Pages->widget(id), "pos"); |
648 animationNewSlide->setDuration(duration); |
652 animationNewSlide->setDuration(duration); |
649 animationNewSlide->setStartValue(QPoint(this->width()*1.5/coeff, 0)); |
653 animationNewSlide->setStartValue(QPoint(width()/coeff, 0)); |
650 animationNewSlide->setEndValue(QPoint(0, 0)); |
654 animationNewSlide->setEndValue(QPoint(0, 0)); |
651 animationNewSlide->setEasingCurve(QEasingCurve::OutExpo); |
655 animationNewSlide->setEasingCurve(QEasingCurve::OutExpo); |
652 |
656 |
653 #ifdef false |
657 #ifdef false |
654 animationNewOpacity = new QPropertyAnimation(effectNew, "opacity"); |
658 animationNewOpacity = new QPropertyAnimation(effectNew, "opacity"); |
662 ui.Pages->widget(lastid)->setHidden(false); |
666 ui.Pages->widget(lastid)->setHidden(false); |
663 |
667 |
664 animationOldSlide = new QPropertyAnimation(ui.Pages->widget(lastid), "pos"); |
668 animationOldSlide = new QPropertyAnimation(ui.Pages->widget(lastid), "pos"); |
665 animationOldSlide->setDuration(duration); |
669 animationOldSlide->setDuration(duration); |
666 animationOldSlide->setStartValue(QPoint(0, 0)); |
670 animationOldSlide->setStartValue(QPoint(0, 0)); |
667 animationOldSlide->setEndValue(QPoint(this->width()*1.5/coeff, 0)); |
671 animationOldSlide->setEndValue(QPoint(-width()/coeff, 0)); |
668 animationOldSlide->setEasingCurve(QEasingCurve::OutExpo); |
672 animationOldSlide->setEasingCurve(QEasingCurve::OutExpo); |
669 |
673 |
670 #ifdef false |
674 #ifdef false |
671 animationOldOpacity = new QPropertyAnimation(effectLast, "opacity"); |
675 animationOldOpacity = new QPropertyAnimation(effectLast, "opacity"); |
672 animationOldOpacity->setDuration(duration); |
676 animationOldOpacity->setDuration(duration); |
683 group->addAnimation(animationNewOpacity); |
687 group->addAnimation(animationNewOpacity); |
684 #endif |
688 #endif |
685 group->start(); |
689 group->start(); |
686 |
690 |
687 connect(animationOldSlide, SIGNAL(finished()), ui.Pages->widget(lastid), SLOT(hide())); |
691 connect(animationOldSlide, SIGNAL(finished()), ui.Pages->widget(lastid), SLOT(hide())); |
|
692 /* this is for the situation when the animation below is interrupted by a new animation. For some reason, finished is not being fired */ |
|
693 for(int i=0;i<MAX_PAGE;i++) if (i!=id && i!=lastid) ui.Pages->widget(i)->hide(); |
688 } |
694 } |
689 #endif |
695 #endif |
690 } |
696 } |
691 |
697 |
692 void HWForm::GoBack() |
698 void HWForm::GoBack() |
716 if ((!hwnet) && (id == ID_PAGE_ROOMSLIST)) |
722 if ((!hwnet) && (id == ID_PAGE_ROOMSLIST)) |
717 { |
723 { |
718 stopAnim = true; |
724 stopAnim = true; |
719 GoBack(); |
725 GoBack(); |
720 } |
726 } |
721 if (curid == ID_PAGE_DRAWMAP) |
727 /*if (curid == ID_PAGE_DRAWMAP) |
722 stopAnim = true; |
728 stopAnim = true; */ |
723 |
729 |
724 if ((!hwnet) || (!hwnet->isInRoom())) |
730 if ((!hwnet) || (!hwnet->isInRoom())) |
725 if (id == ID_PAGE_NETGAME || id == ID_PAGE_NETGAME) |
731 if (id == ID_PAGE_NETGAME || id == ID_PAGE_NETGAME) |
726 { |
732 { |
727 stopAnim = true; |
733 stopAnim = true; |