void IntroWidget::prepareMove() { if (App::app()) App::app()->mtpPause(); if (_cacheHide.isNull() || _cacheHideIndex != current) makeHideCache(); stages[current + moving]->prepareShow(); if (_cacheShow.isNull() || _cacheShowIndex != current + moving) makeShowCache(); int32 m = (moving > 0) ? 1 : -1; a_coordHide = anim::ivalue(0, -m * st::introSlideShift); a_opacityHide = anim::fvalue(1, 0); a_coordShow = anim::ivalue(m * st::introSlideShift, 0); a_opacityShow = anim::fvalue(0, 1); _a_stage.start(); _backTo = stages[current + moving]->hasBack() ? 1 : 0; _backFrom = stages[current]->hasBack() ? 1 : 0; _a_stage.step(); if (_backFrom > 0 || _backTo > 0) { _back.show(); } else { _back.hide(); } stages[current]->deactivate(); stages[current + moving]->hide(); }
void IntroWidget::onDoneStateChanged(int oldState, ButtonStateChangeSource source) { if (_a_stage.animating()) return; if (source == ButtonByPress) { if (oldState & Button::StateDown) { _cacheHide = QPixmap(); } else { makeHideCache(); } } else if (source == ButtonByHover && current != 2) { if (!createNext()) return; if (!_cacheShow) makeShowCache(current + 1); } }
void IntroWidget::prepareMove() { if (cacheForHide.isNull() || cacheForHideInd != current) makeHideCache(); if (cacheForShow.isNull() || cacheForShowInd != current + moving) makeShowCache(); xCoordHide = anim::ivalue(0, -moving * st::introSlideShift); cAlphaHide = anim::fvalue(1, 0); xCoordShow = anim::ivalue(moving * st::introSlideShift, 0); cAlphaShow = anim::fvalue(0, 1); anim::start(this); stages[current]->deactivate(); stages[current + moving]->hide(); }