Fix scroll position restore with pinned bar.
This commit is contained in:
parent
091b62bed4
commit
87e4bb1059
|
@ -3183,11 +3183,20 @@ void HistoryWidget::showAnimated(
|
||||||
_a_show.stop();
|
_a_show.stop();
|
||||||
|
|
||||||
_cacheUnder = params.oldContentCache;
|
_cacheUnder = params.oldContentCache;
|
||||||
|
|
||||||
|
// If we show pinned bar here, we don't want it to change the
|
||||||
|
// calculated and prepared scrollTop of the messages history.
|
||||||
|
_preserveScrollTop = true;
|
||||||
show();
|
show();
|
||||||
_topBar->finishAnimating();
|
_topBar->finishAnimating();
|
||||||
historyDownAnimationFinish();
|
historyDownAnimationFinish();
|
||||||
unreadMentionsAnimationFinish();
|
unreadMentionsAnimationFinish();
|
||||||
|
if (_pinnedBar) {
|
||||||
|
_pinnedBar->finishAnimating();
|
||||||
|
}
|
||||||
_topShadow->setVisible(params.withTopBarShadow ? false : true);
|
_topShadow->setVisible(params.withTopBarShadow ? false : true);
|
||||||
|
_preserveScrollTop = false;
|
||||||
|
|
||||||
_cacheOver = controller()->content()->grabForShowAnimation(params);
|
_cacheOver = controller()->content()->grabForShowAnimation(params);
|
||||||
|
|
||||||
if (_tabbedPanel) {
|
if (_tabbedPanel) {
|
||||||
|
@ -3216,8 +3225,12 @@ void HistoryWidget::animationCallback() {
|
||||||
if (!_a_show.animating()) {
|
if (!_a_show.animating()) {
|
||||||
historyDownAnimationFinish();
|
historyDownAnimationFinish();
|
||||||
unreadMentionsAnimationFinish();
|
unreadMentionsAnimationFinish();
|
||||||
|
if (_pinnedBar) {
|
||||||
|
_pinnedBar->finishAnimating();
|
||||||
|
}
|
||||||
_cacheUnder = _cacheOver = QPixmap();
|
_cacheUnder = _cacheOver = QPixmap();
|
||||||
doneShow();
|
doneShow();
|
||||||
|
synteticScrollToY(_scroll->scrollTop());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -4676,11 +4689,7 @@ void HistoryWidget::updateHistoryGeometry(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
const auto toY = std::clamp(newScrollTop, 0, _scroll->scrollTopMax());
|
const auto toY = std::clamp(newScrollTop, 0, _scroll->scrollTopMax());
|
||||||
if (_scroll->scrollTop() == toY) {
|
synteticScrollToY(toY);
|
||||||
visibleAreaUpdated();
|
|
||||||
} else {
|
|
||||||
synteticScrollToY(toY);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void HistoryWidget::updateListSize() {
|
void HistoryWidget::updateListSize() {
|
||||||
|
|
Loading…
Reference in New Issue