Fixed issue that caused peer list box height to fluctuate on show.

Related commit: 64975f2dd5.
This commit is contained in:
23rd
2026-01-04 11:05:25 +03:00
committed by John Preston
parent e6ad773c89
commit bb7c4fbb21
3 changed files with 20 additions and 10 deletions
+10 -4
View File
@@ -185,10 +185,7 @@ void PeerListBox::prepare() {
object_ptr<PeerListContent>(
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) {
@@ -148,10 +148,7 @@ void PeerListsBox::updateScrollSkips() {
void PeerListsBox::prepare() {
auto rows = setInnerWidget(
object_ptr<Ui::VerticalLayout>(this),
st::boxScroll,
0,
0,
true /*alwaysKeepDimensionsToInner*/);
st::boxScroll);
for (auto &list : _lists) {
const auto content = rows->add(object_ptr<PeerListContent>(
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);