From 3d61da74edbec2fad7ef3d2ec5718f8e86138fc5 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 28 Dec 2025 11:35:05 +0300 Subject: [PATCH] Increased height of various boxes with participants list. --- .../boxes/peers/edit_participants_box.cpp | 13 +++++++++++++ .../SourceFiles/boxes/peers/edit_participants_box.h | 1 + 2 files changed, 14 insertions(+) diff --git a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp index b0004bcc86..6f876209f7 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp +++ b/Telegram/SourceFiles/boxes/peers/edit_participants_box.cpp @@ -33,10 +33,12 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "ui/widgets/menu/menu_multiline_action.h" #include "ui/widgets/popup_menu.h" #include "ui/text/text_utilities.h" +#include "ui/rect.h" #include "info/profile/info_profile_values.h" #include "window/window_session_controller.h" #include "history/history.h" #include "styles/style_chat.h" +#include "styles/style_layers.h" #include "styles/style_menu_icons.h" namespace { @@ -1212,6 +1214,17 @@ rpl::producer ParticipantsBoxController::fullCountValue() const { return _fullCountValue.value(); } +rpl::producer ParticipantsBoxController::boxHeightValue() const { + return _fullCountValue.value() | rpl::map([=](int count) { + const auto &st = computeListSt(); + const auto searchHeight = st.item.height; + const auto listHeight = count * st.item.height; + return std::max( + searchHeight + listHeight + rect::m::sum::v(st.padding), + st::boxMaxListHeight); + }); +} + void ParticipantsBoxController::setStoriesShown(bool shown) { _stories = std::make_unique( this, diff --git a/Telegram/SourceFiles/boxes/peers/edit_participants_box.h b/Telegram/SourceFiles/boxes/peers/edit_participants_box.h index 6e14120302..622c2f1be4 100644 --- a/Telegram/SourceFiles/boxes/peers/edit_participants_box.h +++ b/Telegram/SourceFiles/boxes/peers/edit_participants_box.h @@ -202,6 +202,7 @@ public: [[nodiscard]] rpl::producer onlineCountValue() const; [[nodiscard]] rpl::producer fullCountValue() const; + [[nodiscard]] rpl::producer boxHeightValue() const override; void setStoriesShown(bool shown);