Fix animation lag in info layer wrap.

This commit is contained in:
John Preston 2017-11-06 12:50:54 +04:00
parent a7807420fa
commit a05c7a815a
3 changed files with 10 additions and 7 deletions

View File

@ -440,6 +440,7 @@ void Widget::onScroll() {
void Widget::showAnimatedHook(
const Window::SectionSlideParams &params) {
_fixedBar->setAnimatingMode(true);
if (params.withTopBarShadow) _fixedBarShadow->show();
}
void Widget::showFinishedHook() {

View File

@ -66,7 +66,10 @@ WrapWidget::WrapWidget(
, _wrap(wrap)
, _controller(createController(window, memento->content()))
, _topShadow(this) {
_topShadow->toggleOn(topShadowToggledValue());
_topShadow->toggleOn(topShadowToggledValue()
| rpl::filter([](bool shown) {
return true;
}));
_wrap.changes()
| rpl::start_with_next([this] {
setupTop();
@ -452,7 +455,7 @@ QPixmap WrapWidget::grabForShowAnimation(
if (params.withTopBarShadow) {
_topShadow->setVisible(false);
} else {
_topShadow->toggle(_topShadow->toggled(), anim::type::instant);
_topShadow->setVisible(_topShadow->toggled());
}
if (params.withTabs && _topTabs) {
_topTabs->hide();
@ -473,6 +476,9 @@ void WrapWidget::showAnimatedHook(
_topTabs->show();
_topTabsBackground->show();
}
if (params.withTopBarShadow) {
_topShadow->setVisible(true);
}
}
void WrapWidget::doSetInnerFocus() {
@ -544,7 +550,7 @@ void WrapWidget::showNewContent(
&& newContent->hasTopBarShadow();
animationParams.oldContentCache = grabForShowAnimation(
animationParams);
// animationParams.withFade = (wrap() == Wrap::Layer);
animationParams.withFade = (wrap() == Wrap::Layer);
}
if (saveToStack) {
auto item = StackItem();

View File

@ -71,10 +71,6 @@ void SlideAnimation::paintContents(Painter &p, const QRect &update) const {
p.setOpacity(progress);
st::slideShadow.fill(p, QRect(coordOver - st::slideShadow.width(), 0, st::slideShadow.width(), _cacheOver.height() / retina));
}
if (_topBarShadowEnabled) {
p.setOpacity(1);
p.fillRect(0, st::topBarHeight, _cacheOver.width() / retina, st::lineWidth, st::shadowFg);
}
}
void SlideAnimation::setDirection(SlideDirection direction) {