2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Improve Emoji / GIFs list variable width support.

This commit is contained in:
John Preston
2017-11-14 14:26:12 +04:00
parent defa0ae4d0
commit fafcd02e7c
11 changed files with 42 additions and 32 deletions

View File

@@ -269,7 +269,7 @@ RecentEmojiPack &GetRecent() {
0xD83DDE15LLU,
};
for (auto oldKey : defaultRecent) {
if (result.size() >= kPanelPerRow * kPanelRowsPerPage) break;
if (result.size() >= kRecentLimit) break;
if (auto emoji = Ui::Emoji::FromOldKey(oldKey)) {
if (!haveAlready(emoji)) {
@@ -307,7 +307,9 @@ void AddRecent(EmojiPtr emoji) {
}
}
if (i == e) {
while (recent.size() >= kPanelPerRow * kPanelRowsPerPage) recent.pop_back();
while (recent.size() >= kRecentLimit) {
recent.pop_back();
}
recent.push_back(qMakePair(emoji, 1));
for (i = recent.end() - 1; i != recent.begin(); --i) {
if ((i - 1)->second > i->second) {