mirror of
https://github.com/vale981/tdesktop
synced 2025-03-06 10:11:41 -05:00
fixed scrolling issues when switching between conversations
This commit is contained in:
parent
02ca81ac64
commit
2ead44d9c0
1 changed files with 7 additions and 4 deletions
|
@ -3776,7 +3776,6 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re
|
|||
_scroll.hide();
|
||||
_scroll.setWidget(_list);
|
||||
_list->show();
|
||||
visibleAreaUpdated();
|
||||
|
||||
_updateHistoryItems.stop();
|
||||
|
||||
|
@ -6411,11 +6410,11 @@ MsgId HistoryWidget::replyToId() const {
|
|||
|
||||
void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollChange &change) {
|
||||
if (!_history || (initial && _histInited) || (!initial && !_histInited)) return;
|
||||
if (_firstLoadRequest) {
|
||||
if (_firstLoadRequest || _a_show.animating()) {
|
||||
return; // scrollTopMax etc are not working after recountHeight()
|
||||
}
|
||||
|
||||
int32 newScrollHeight = height();
|
||||
int newScrollHeight = height();
|
||||
if (isBlocked() || isBotStart() || isJoinChannel() || isMuteUnmute()) {
|
||||
newScrollHeight -= _unblock.height();
|
||||
} else {
|
||||
|
@ -6435,7 +6434,11 @@ void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollCh
|
|||
bool wasAtBottom = _scroll.scrollTop() + 1 > _scroll.scrollTopMax(), needResize = _scroll.width() != width() || _scroll.height() != newScrollHeight;
|
||||
if (needResize) {
|
||||
_scroll.resize(width(), newScrollHeight);
|
||||
// on initial updateListSize we didn't put the _scroll.scrollTop correctly yet
|
||||
// so visibleAreaUpdated() call will erase it with the new (undefined) value
|
||||
if (!initial) {
|
||||
visibleAreaUpdated();
|
||||
}
|
||||
|
||||
_attachMention.setBoundings(_scroll.geometry());
|
||||
_toHistoryEnd.move((width() - _toHistoryEnd.width()) / 2, _scroll.y() + _scroll.height() - _toHistoryEnd.height() - st::historyToEndSkip);
|
||||
|
|
Loading…
Add table
Reference in a new issue