mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 15:47:11 +02:00
Fix restoring scroll state with a pinned bar.
This commit is contained in:
parent
07f07c5eeb
commit
a21b6d7416
2 changed files with 6 additions and 1 deletions
|
@ -3230,6 +3230,9 @@ void HistoryWidget::doneShow() {
|
|||
} else {
|
||||
handlePendingHistoryUpdate();
|
||||
}
|
||||
// If we show pinned bar here, we don't want it to change the
|
||||
// calculated and prepared scrollTop of the messages history.
|
||||
_preserveScrollTop = true;
|
||||
preloadHistoryIfNeeded();
|
||||
updatePinnedViewer();
|
||||
if (_pinnedBar) {
|
||||
|
@ -3237,6 +3240,7 @@ void HistoryWidget::doneShow() {
|
|||
}
|
||||
checkHistoryActivation();
|
||||
App::wnd()->setInnerFocus();
|
||||
_preserveScrollTop = false;
|
||||
}
|
||||
|
||||
void HistoryWidget::finishAnimating() {
|
||||
|
@ -5330,7 +5334,7 @@ void HistoryWidget::checkPinnedBarState() {
|
|||
_pinnedBarHeight = 0;
|
||||
_pinnedBar->heightValue(
|
||||
) | rpl::start_with_next([=](int height) {
|
||||
_topDelta = (height - _pinnedBarHeight);
|
||||
_topDelta = _preserveScrollTop ? 0 : (height - _pinnedBarHeight);
|
||||
_pinnedBarHeight = height;
|
||||
updateHistoryGeometry();
|
||||
updateControlsGeometry();
|
||||
|
|
|
@ -599,6 +599,7 @@ private:
|
|||
std::unique_ptr<HistoryView::PinnedTracker> _pinnedTracker;
|
||||
std::unique_ptr<Ui::PinnedBar> _pinnedBar;
|
||||
int _pinnedBarHeight = 0;
|
||||
bool _preserveScrollTop = false;
|
||||
FullMsgId _pinnedClickedId;
|
||||
std::optional<FullMsgId> _minPinnedId;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue