diff --git a/Telegram/SourceFiles/boxes/peer_list_box.cpp b/Telegram/SourceFiles/boxes/peer_list_box.cpp index be9431cdf8..ea3f726ad2 100644 --- a/Telegram/SourceFiles/boxes/peer_list_box.cpp +++ b/Telegram/SourceFiles/boxes/peer_list_box.cpp @@ -185,10 +185,7 @@ void PeerListBox::prepare() { object_ptr( this, _controller.get()), - st::boxScroll, - 0, - 0, - true /*alwaysKeepDimensionsToInner*/)); + st::boxScroll)); content()->resizeToWidth(_controller->contentWidth()); _controller->setDelegate(this); @@ -213,6 +210,15 @@ void PeerListBox::prepare() { if (_init) { _init(this); } + + { + setDimensions( + _controller->contentWidth(), + std::clamp( + content()->height(), + st::boxMaxListHeight, + st::boxMaxListHeight * 3)); + } } void PeerListBox::keyPressEvent(QKeyEvent *e) { diff --git a/Telegram/SourceFiles/boxes/peer_lists_box.cpp b/Telegram/SourceFiles/boxes/peer_lists_box.cpp index 1459351c15..4506075cec 100644 --- a/Telegram/SourceFiles/boxes/peer_lists_box.cpp +++ b/Telegram/SourceFiles/boxes/peer_lists_box.cpp @@ -148,10 +148,7 @@ void PeerListsBox::updateScrollSkips() { void PeerListsBox::prepare() { auto rows = setInnerWidget( object_ptr(this), - st::boxScroll, - 0, - 0, - true /*alwaysKeepDimensionsToInner*/); + st::boxScroll); for (auto &list : _lists) { const auto content = rows->add(object_ptr( rows, @@ -181,7 +178,14 @@ void PeerListsBox::prepare() { } rows->resizeToWidth(firstController()->contentWidth()); - setDimensions(firstController()->contentWidth(), st::boxMaxListHeight); + { + setDimensions( + firstController()->contentWidth(), + std::clamp( + rows->height(), + st::boxMaxListHeight, + st::boxMaxListHeight * 3)); + } if (_select) { _select->finishAnimating(); Ui::SendPendingMoveResizeEvents(_select); diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 3faf86b9cf..7469948aeb 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 3faf86b9cf9befa9307bbb47833578a68ef18ea0 +Subproject commit 7469948aebd111e6543400feb9828bda984cc9fa