diff options
author | John Preston <johnprestonmail@gmail.com> | 2022-09-22 12:27:46 +0400 |
---|---|---|
committer | John Preston <johnprestonmail@gmail.com> | 2022-09-22 12:27:46 +0400 |
commit | f0a36d64601b79e5929d3da43e0bcaf7675da1ba (patch) | |
tree | d93c9d90ee0fb401dba452d394e2fd3efe15f18a | |
parent | ffb024a5f73c6d5a27188542e7bd6feeb79eea7c (diff) |
Show only first row of colored default statuses.
-rw-r--r-- | Telegram/SourceFiles/info/profile/info_profile_emoji_status_panel.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Telegram/SourceFiles/info/profile/info_profile_emoji_status_panel.cpp b/Telegram/SourceFiles/info/profile/info_profile_emoji_status_panel.cpp index 6a00a9f62a..6c32c16286 100644 --- a/Telegram/SourceFiles/info/profile/info_profile_emoji_status_panel.cpp +++ b/Telegram/SourceFiles/info/profile/info_profile_emoji_status_panel.cpp @@ -33,6 +33,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL namespace Info::Profile { namespace { +constexpr auto kLimitFirstRow = 8; + void PickUntilBox(not_null<Ui::GenericBox*> box, Fn<void(TimeId)> callback) { box->setTitle(tr::lng_emoji_status_for_title()); @@ -179,6 +181,9 @@ void EmojiStatusPanel::show( const auto &other = statuses.list(Data::EmojiStatuses::Type::Default); auto list = statuses.list(Data::EmojiStatuses::Type::Colored); list.insert(begin(list), 0); + if (list.size() > kLimitFirstRow) { + list.erase(begin(list) + kLimitFirstRow, end(list)); + } list.reserve(list.size() + recent.size() + other.size() + 1); for (const auto &id : ranges::views::concat(recent, other)) { if (!ranges::contains(list, id)) { |