Improve scroll to unread bar.

This commit is contained in:
John Preston 2020-09-29 18:05:38 +03:00
parent e8df47c926
commit 62da24c20b
2 changed files with 3 additions and 1 deletions

View File

@ -528,9 +528,10 @@ void ListWidget::restoreScrollState() {
return;
}
if (!_scrollTopState.item) {
if (!_bar.element || !_bar.focus) {
if (!_bar.element || !_bar.focus || _scrollInited) {
return;
}
_scrollInited = true;
_scrollTopState.item = _bar.element->data()->position();
_scrollTopState.shift = st::lineWidth + st::historyUnreadBarMargin;
}

View File

@ -496,6 +496,7 @@ private:
Ui::Animations::Simple _scrollToAnimation;
Fn<bool()> _overrideInitialScroll;
bool _scrollInited = false;
bool _scrollDateShown = false;
Ui::Animations::Simple _scrollDateOpacity;
SingleQueuedInvokation _scrollDateCheck;