diff --git a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp index fc29b7fca1..4aba00661e 100644 --- a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp @@ -337,6 +337,15 @@ void RepliesWidget::setupRootView() { _rootShadow->showOn(_rootView->shownValue()); _rootView->hide(anim::type::instant); + _rootViewHeight = 0; + + _rootView->heightValue( + ) | rpl::start_with_next([=](int height) { + if (const auto delta = height - _rootViewHeight) { + _rootViewHeight = height; + setGeometryWithTopMoved(geometry(), delta); + } + }, _rootView->lifetime()); } void RepliesWidget::setupCommentsRoot() { @@ -1369,7 +1378,8 @@ void RepliesWidget::updateControlsGeometry() { const auto bottom = height(); const auto controlsHeight = _composeControls->heightCurrent(); - const auto scrollHeight = bottom - _topBar->height() - controlsHeight; + const auto scrollY = _topBar->height() + _rootView->height(); + const auto scrollHeight = bottom - scrollY - controlsHeight; const auto scrollSize = QSize(contentWidth, scrollHeight); if (_scroll->size() != scrollSize) { _skipScrollEvent = true; @@ -1377,6 +1387,7 @@ void RepliesWidget::updateControlsGeometry() { _inner->resizeToWidth(scrollSize.width(), _scroll->height()); _skipScrollEvent = false; } + _scroll->move(0, scrollY); if (!_scroll->isHidden()) { if (newScrollTop) { _scroll->scrollToY(*newScrollTop); diff --git a/Telegram/SourceFiles/history/view/history_view_replies_section.h b/Telegram/SourceFiles/history/view/history_view_replies_section.h index fcaf23cb4b..9a8e96fd44 100644 --- a/Telegram/SourceFiles/history/view/history_view_replies_section.h +++ b/Telegram/SourceFiles/history/view/history_view_replies_section.h @@ -247,6 +247,7 @@ private: Ui::Text::String _rootTitle; Ui::Text::String _rootMessage; object_ptr> _rootView; + int _rootViewHeight = 0; object_ptr _rootShadow; std::unique_ptr _scroll;