mirror of https://github.com/procxx/kepka.git
Fix animation lag in info layer wrap.
This commit is contained in:
parent
a7807420fa
commit
a05c7a815a
|
@ -440,6 +440,7 @@ void Widget::onScroll() {
|
||||||
void Widget::showAnimatedHook(
|
void Widget::showAnimatedHook(
|
||||||
const Window::SectionSlideParams ¶ms) {
|
const Window::SectionSlideParams ¶ms) {
|
||||||
_fixedBar->setAnimatingMode(true);
|
_fixedBar->setAnimatingMode(true);
|
||||||
|
if (params.withTopBarShadow) _fixedBarShadow->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Widget::showFinishedHook() {
|
void Widget::showFinishedHook() {
|
||||||
|
|
|
@ -66,7 +66,10 @@ WrapWidget::WrapWidget(
|
||||||
, _wrap(wrap)
|
, _wrap(wrap)
|
||||||
, _controller(createController(window, memento->content()))
|
, _controller(createController(window, memento->content()))
|
||||||
, _topShadow(this) {
|
, _topShadow(this) {
|
||||||
_topShadow->toggleOn(topShadowToggledValue());
|
_topShadow->toggleOn(topShadowToggledValue()
|
||||||
|
| rpl::filter([](bool shown) {
|
||||||
|
return true;
|
||||||
|
}));
|
||||||
_wrap.changes()
|
_wrap.changes()
|
||||||
| rpl::start_with_next([this] {
|
| rpl::start_with_next([this] {
|
||||||
setupTop();
|
setupTop();
|
||||||
|
@ -452,7 +455,7 @@ QPixmap WrapWidget::grabForShowAnimation(
|
||||||
if (params.withTopBarShadow) {
|
if (params.withTopBarShadow) {
|
||||||
_topShadow->setVisible(false);
|
_topShadow->setVisible(false);
|
||||||
} else {
|
} else {
|
||||||
_topShadow->toggle(_topShadow->toggled(), anim::type::instant);
|
_topShadow->setVisible(_topShadow->toggled());
|
||||||
}
|
}
|
||||||
if (params.withTabs && _topTabs) {
|
if (params.withTabs && _topTabs) {
|
||||||
_topTabs->hide();
|
_topTabs->hide();
|
||||||
|
@ -473,6 +476,9 @@ void WrapWidget::showAnimatedHook(
|
||||||
_topTabs->show();
|
_topTabs->show();
|
||||||
_topTabsBackground->show();
|
_topTabsBackground->show();
|
||||||
}
|
}
|
||||||
|
if (params.withTopBarShadow) {
|
||||||
|
_topShadow->setVisible(true);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WrapWidget::doSetInnerFocus() {
|
void WrapWidget::doSetInnerFocus() {
|
||||||
|
@ -544,7 +550,7 @@ void WrapWidget::showNewContent(
|
||||||
&& newContent->hasTopBarShadow();
|
&& newContent->hasTopBarShadow();
|
||||||
animationParams.oldContentCache = grabForShowAnimation(
|
animationParams.oldContentCache = grabForShowAnimation(
|
||||||
animationParams);
|
animationParams);
|
||||||
// animationParams.withFade = (wrap() == Wrap::Layer);
|
animationParams.withFade = (wrap() == Wrap::Layer);
|
||||||
}
|
}
|
||||||
if (saveToStack) {
|
if (saveToStack) {
|
||||||
auto item = StackItem();
|
auto item = StackItem();
|
||||||
|
|
|
@ -71,10 +71,6 @@ void SlideAnimation::paintContents(Painter &p, const QRect &update) const {
|
||||||
p.setOpacity(progress);
|
p.setOpacity(progress);
|
||||||
st::slideShadow.fill(p, QRect(coordOver - st::slideShadow.width(), 0, st::slideShadow.width(), _cacheOver.height() / retina));
|
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) {
|
void SlideAnimation::setDirection(SlideDirection direction) {
|
||||||
|
|
Loading…
Reference in New Issue