mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-19 07:37:11 +02:00
Resize scroll area together with pinned root message.
This commit is contained in:
parent
b097bd7225
commit
e021e0beb3
2 changed files with 13 additions and 1 deletions
|
@ -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);
|
||||
|
|
|
@ -247,6 +247,7 @@ private:
|
|||
Ui::Text::String _rootTitle;
|
||||
Ui::Text::String _rootMessage;
|
||||
object_ptr<Ui::SlideWrap<Ui::RpWidget>> _rootView;
|
||||
int _rootViewHeight = 0;
|
||||
object_ptr<Ui::PlainShadow> _rootShadow;
|
||||
|
||||
std::unique_ptr<Ui::ScrollArea> _scroll;
|
||||
|
|
Loading…
Add table
Reference in a new issue