mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Show only first row of colored default statuses.
This commit is contained in:
parent
ffb024a5f7
commit
f0a36d6460
1 changed files with 5 additions and 0 deletions
|
@ -33,6 +33,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
namespace Info::Profile {
|
namespace Info::Profile {
|
||||||
namespace {
|
namespace {
|
||||||
|
|
||||||
|
constexpr auto kLimitFirstRow = 8;
|
||||||
|
|
||||||
void PickUntilBox(not_null<Ui::GenericBox*> box, Fn<void(TimeId)> callback) {
|
void PickUntilBox(not_null<Ui::GenericBox*> box, Fn<void(TimeId)> callback) {
|
||||||
box->setTitle(tr::lng_emoji_status_for_title());
|
box->setTitle(tr::lng_emoji_status_for_title());
|
||||||
|
|
||||||
|
@ -179,6 +181,9 @@ void EmojiStatusPanel::show(
|
||||||
const auto &other = statuses.list(Data::EmojiStatuses::Type::Default);
|
const auto &other = statuses.list(Data::EmojiStatuses::Type::Default);
|
||||||
auto list = statuses.list(Data::EmojiStatuses::Type::Colored);
|
auto list = statuses.list(Data::EmojiStatuses::Type::Colored);
|
||||||
list.insert(begin(list), 0);
|
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);
|
list.reserve(list.size() + recent.size() + other.size() + 1);
|
||||||
for (const auto &id : ranges::views::concat(recent, other)) {
|
for (const auto &id : ranges::views::concat(recent, other)) {
|
||||||
if (!ranges::contains(list, id)) {
|
if (!ranges::contains(list, id)) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue