Skip to content

Commit bb7c4fb

Browse files
23rdjohn-preston
authored andcommitted
Fixed issue that caused peer list box height to fluctuate on show.
Related commit: 64975f2.
1 parent e6ad773 commit bb7c4fb

File tree

3 files changed

+20
-10
lines changed

3 files changed

+20
-10
lines changed

Telegram/SourceFiles/boxes/peer_list_box.cpp

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,7 @@ void PeerListBox::prepare() {
185185
object_ptr<PeerListContent>(
186186
this,
187187
_controller.get()),
188-
st::boxScroll,
189-
0,
190-
0,
191-
true /*alwaysKeepDimensionsToInner*/));
188+
st::boxScroll));
192189
content()->resizeToWidth(_controller->contentWidth());
193190

194191
_controller->setDelegate(this);
@@ -213,6 +210,15 @@ void PeerListBox::prepare() {
213210
if (_init) {
214211
_init(this);
215212
}
213+
214+
{
215+
setDimensions(
216+
_controller->contentWidth(),
217+
std::clamp(
218+
content()->height(),
219+
st::boxMaxListHeight,
220+
st::boxMaxListHeight * 3));
221+
}
216222
}
217223

218224
void PeerListBox::keyPressEvent(QKeyEvent *e) {

Telegram/SourceFiles/boxes/peer_lists_box.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,7 @@ void PeerListsBox::updateScrollSkips() {
148148
void PeerListsBox::prepare() {
149149
auto rows = setInnerWidget(
150150
object_ptr<Ui::VerticalLayout>(this),
151-
st::boxScroll,
152-
0,
153-
0,
154-
true /*alwaysKeepDimensionsToInner*/);
151+
st::boxScroll);
155152
for (auto &list : _lists) {
156153
const auto content = rows->add(object_ptr<PeerListContent>(
157154
rows,
@@ -181,7 +178,14 @@ void PeerListsBox::prepare() {
181178
}
182179
rows->resizeToWidth(firstController()->contentWidth());
183180

184-
setDimensions(firstController()->contentWidth(), st::boxMaxListHeight);
181+
{
182+
setDimensions(
183+
firstController()->contentWidth(),
184+
std::clamp(
185+
rows->height(),
186+
st::boxMaxListHeight,
187+
st::boxMaxListHeight * 3));
188+
}
185189
if (_select) {
186190
_select->finishAnimating();
187191
Ui::SendPendingMoveResizeEvents(_select);

0 commit comments

Comments
 (0)