2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 06:26:18 +00:00

Use emoji/stickers/gifs slider in EmojiPan.

Also rename EmojiTabs to EmojiSections.
This commit is contained in:
John Preston
2017-03-28 15:30:38 +03:00
parent 3d846fcd49
commit 1540f6f528
23 changed files with 1466 additions and 1424 deletions

View File

@@ -393,18 +393,18 @@ void Init() {\n\
bool Generator::writePacks() {
constexpr const char *packNames[] = {
"dbietPeople",
"dbietNature",
"dbietFood",
"dbietActivity",
"dbietTravel",
"dbietObjects",
"dbietSymbols",
"dbiesPeople",
"dbiesNature",
"dbiesFood",
"dbiesActivity",
"dbiesTravel",
"dbiesObjects",
"dbiesSymbols",
};
source_->stream() << "\
\n\
int GetPackCount(DBIEmojiTab tab) {\n\
switch (tab) {\n";
int GetPackCount(DBIEmojiSection section) {\n\
switch (section) {\n";
auto countIndex = 0;
for (auto name : packNames) {
if (countIndex >= int(data_.categories.size())) {
@@ -415,13 +415,13 @@ int GetPackCount(DBIEmojiTab tab) {\n\
case " << name << ": return " << data_.categories[countIndex++].size() << ";\n";
}
source_->stream() << "\
case dbietRecent: return cGetRecentEmoji().size();\n\
case dbiesRecent: return GetRecent().size();\n\
}\n\
return 0;\n\
}\n\
\n\
EmojiPack GetPack(DBIEmojiTab tab) {\n\
switch (tab) {\n";
EmojiPack GetPack(DBIEmojiSection section) {\n\
switch (section) {\n";
auto index = 0;
for (auto name : packNames) {
if (index >= int(data_.categories.size())) {
@@ -444,10 +444,10 @@ EmojiPack GetPack(DBIEmojiTab tab) {\n\
} break;\n\n";
}
source_->stream() << "\
case dbietRecent: {\n\
case dbiesRecent: {\n\
auto result = EmojiPack();\n\
result.reserve(cGetRecentEmoji().size());\n\
for (auto &item : cGetRecentEmoji()) {\n\
result.reserve(GetRecent().size());\n\
for (auto &item : GetRecent()) {\n\
result.push_back(item.first);\n\
}\n\
return result;\n\