mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-16 06:07:06 +02:00
Fix scroll in return to a channel I'm not in.
This commit is contained in:
parent
a6484e6131
commit
fcfacf1f9d
2 changed files with 11 additions and 2 deletions
|
@ -2189,7 +2189,8 @@ void HistoryWidget::showHistory(
|
|||
_chooseForReport = nullptr;
|
||||
}
|
||||
if (_showAtMsgId == ShowAtUnreadMsgId
|
||||
&& !_history->trackUnreadMessages()) {
|
||||
&& !_history->trackUnreadMessages()
|
||||
&& !hasSavedScroll()) {
|
||||
_showAtMsgId = ShowAtTheEndMsgId;
|
||||
}
|
||||
refreshTopBarActiveChat();
|
||||
|
@ -5394,8 +5395,15 @@ MsgId HistoryWidget::replyToId() const {
|
|||
return _replyToId ? _replyToId : (_kbReplyTo ? _kbReplyTo->id : 0);
|
||||
}
|
||||
|
||||
bool HistoryWidget::hasSavedScroll() const {
|
||||
Expects(_history != nullptr);
|
||||
|
||||
return _history->scrollTopItem
|
||||
|| (_migrated && _migrated->scrollTopItem);
|
||||
}
|
||||
|
||||
int HistoryWidget::countInitialScrollTop() {
|
||||
if (_history->scrollTopItem || (_migrated && _migrated->scrollTopItem)) {
|
||||
if (hasSavedScroll()) {
|
||||
return _list->historyScrollTop();
|
||||
} else if (_showAtMsgId
|
||||
&& (IsServerMsgId(_showAtMsgId)
|
||||
|
|
|
@ -573,6 +573,7 @@ private:
|
|||
|
||||
// when scroll position or scroll area size changed this method
|
||||
// updates the boundings of the visible area in HistoryInner
|
||||
[[nodiscard]] bool hasSavedScroll() const;
|
||||
void visibleAreaUpdated();
|
||||
int countInitialScrollTop();
|
||||
int countAutomaticScrollTop();
|
||||
|
|
Loading…
Add table
Reference in a new issue