mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-25 06:54:43 +00:00
Fixed issue that caused peer list box height to fluctuate on show.
Related commit: 64975f2dd5.
This commit is contained in:
@@ -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);
|
||||
|
||||
+1
-1
Submodule Telegram/lib_ui updated: 3faf86b9cf...7469948aeb
Reference in New Issue
Block a user