2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-05 08:55:59 +00:00

sticker packs order now is saved, new packs added to the top, fixed emoji categories icons

This commit is contained in:
John Preston
2015-05-21 13:44:26 +03:00
parent cfdacb09ac
commit 18361ce144
9 changed files with 74 additions and 44 deletions

View File

@@ -1386,13 +1386,10 @@ void StickerPanInner::refreshStickers() {
refreshRecent(false);
StickerSets::const_iterator it;
it = sets.constFind(CustomStickerSetId); if (it != sets.cend()) appendSet(it);
it = sets.constFind(DefaultStickerSetId); if (it != sets.cend()) appendSet(it);
for (it = sets.cbegin(); it != sets.cend(); ++it) {
if (it->id != CustomStickerSetId && it->id != DefaultStickerSetId) appendSet(it);
appendSet(CustomStickerSetId);
appendSet(DefaultStickerSetId);
for (StickerSetsOrder::const_iterator i = cStickerSetsOrder().cbegin(), e = cStickerSetsOrder().cend(); i != e; ++i) {
appendSet(*i);
}
int32 h = countHeight();
@@ -1431,8 +1428,10 @@ void StickerPanInner::preloadImages() {
}
}
void StickerPanInner::appendSet(StickerSets::const_iterator it) {
if (it->stickers.isEmpty()) return;
void StickerPanInner::appendSet(uint64 setId) {
const StickerSets &sets(cStickerSets());
StickerSets::const_iterator it = sets.constFind(setId);
if (it == sets.cend() || it->stickers.isEmpty()) return;
StickerPack pack;
pack.reserve(it->stickers.size());
@@ -2046,6 +2045,7 @@ void EmojiPan::onRemoveSetSure() {
}
}
cRefStickerSets().erase(it);
cRefStickerSetsOrder().removeOne(_removingSetId);
cSetStickersHash(QByteArray());
refreshStickers();
Local::writeStickers();