mirror of https://github.com/procxx/kepka.git
fixed scrolling issues when switching between conversations
This commit is contained in:
parent
02ca81ac64
commit
2ead44d9c0
|
@ -3776,7 +3776,6 @@ void HistoryWidget::showHistory(const PeerId &peerId, MsgId showAtMsgId, bool re
|
||||||
_scroll.hide();
|
_scroll.hide();
|
||||||
_scroll.setWidget(_list);
|
_scroll.setWidget(_list);
|
||||||
_list->show();
|
_list->show();
|
||||||
visibleAreaUpdated();
|
|
||||||
|
|
||||||
_updateHistoryItems.stop();
|
_updateHistoryItems.stop();
|
||||||
|
|
||||||
|
@ -6411,11 +6410,11 @@ MsgId HistoryWidget::replyToId() const {
|
||||||
|
|
||||||
void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollChange &change) {
|
void HistoryWidget::updateListSize(bool initial, bool loadedDown, const ScrollChange &change) {
|
||||||
if (!_history || (initial && _histInited) || (!initial && !_histInited)) return;
|
if (!_history || (initial && _histInited) || (!initial && !_histInited)) return;
|
||||||
if (_firstLoadRequest) {
|
if (_firstLoadRequest || _a_show.animating()) {
|
||||||
return; // scrollTopMax etc are not working after recountHeight()
|
return; // scrollTopMax etc are not working after recountHeight()
|
||||||
}
|
}
|
||||||
|
|
||||||
int32 newScrollHeight = height();
|
int newScrollHeight = height();
|
||||||
if (isBlocked() || isBotStart() || isJoinChannel() || isMuteUnmute()) {
|
if (isBlocked() || isBotStart() || isJoinChannel() || isMuteUnmute()) {
|
||||||
newScrollHeight -= _unblock.height();
|
newScrollHeight -= _unblock.height();
|
||||||
} else {
|
} 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;
|
bool wasAtBottom = _scroll.scrollTop() + 1 > _scroll.scrollTopMax(), needResize = _scroll.width() != width() || _scroll.height() != newScrollHeight;
|
||||||
if (needResize) {
|
if (needResize) {
|
||||||
_scroll.resize(width(), newScrollHeight);
|
_scroll.resize(width(), newScrollHeight);
|
||||||
visibleAreaUpdated();
|
// 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());
|
_attachMention.setBoundings(_scroll.geometry());
|
||||||
_toHistoryEnd.move((width() - _toHistoryEnd.width()) / 2, _scroll.y() + _scroll.height() - _toHistoryEnd.height() - st::historyToEndSkip);
|
_toHistoryEnd.move((width() - _toHistoryEnd.width()) / 2, _scroll.y() + _scroll.height() - _toHistoryEnd.height() - st::historyToEndSkip);
|
||||||
|
|
Loading…
Reference in New Issue