Show faved stickers in StickersListWidget.
Before Width: | Height: | Size: 639 B After Width: | Height: | Size: 658 B |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 692 B |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 501 B After Width: | Height: | Size: 516 B |
Before Width: | Height: | Size: 777 B After Width: | Height: | Size: 788 B |
Before Width: | Height: | Size: 554 B After Width: | Height: | Size: 569 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 360 B After Width: | Height: | Size: 366 B |
Before Width: | Height: | Size: 628 B After Width: | Height: | Size: 644 B |
Before Width: | Height: | Size: 668 B After Width: | Height: | Size: 694 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 546 B After Width: | Height: | Size: 568 B |
Before Width: | Height: | Size: 968 B After Width: | Height: | Size: 986 B |
Before Width: | Height: | Size: 606 B After Width: | Height: | Size: 788 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.7 KiB |
Before Width: | Height: | Size: 432 B After Width: | Height: | Size: 439 B |
Before Width: | Height: | Size: 859 B After Width: | Height: | Size: 880 B |
Before Width: | Height: | Size: 465 B After Width: | Height: | Size: 449 B |
Before Width: | Height: | Size: 817 B After Width: | Height: | Size: 836 B |
Before Width: | Height: | Size: 546 B After Width: | Height: | Size: 562 B |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
@ -103,7 +103,7 @@ stickersRowDuration: 200;
|
||||||
|
|
||||||
stickersSettings: icon {{ "emoji_settings", emojiIconFg }};
|
stickersSettings: icon {{ "emoji_settings", emojiIconFg }};
|
||||||
stickersTrending: icon {{ "emoji_trending", emojiIconFg }};
|
stickersTrending: icon {{ "emoji_trending", emojiIconFg }};
|
||||||
stickersTrendingActive: icon {{ "emoji_trending", emojiIconFgActive }};
|
stickersFaved: icon {{ "emoji_faved", emojiIconFg }};
|
||||||
|
|
||||||
stickersSettingsUnreadSize: 17px;
|
stickersSettingsUnreadSize: 17px;
|
||||||
stickersSettingsUnreadPosition: point(4px, 5px);
|
stickersSettingsUnreadPosition: point(4px, 5px);
|
||||||
|
@ -137,7 +137,7 @@ emojiCategory: IconButton {
|
||||||
width: 42px;
|
width: 42px;
|
||||||
height: 46px;
|
height: 46px;
|
||||||
|
|
||||||
iconPosition: point(11px, 12px);
|
iconPosition: point(10px, 11px);
|
||||||
}
|
}
|
||||||
emojiCategoryRecent: IconButton(emojiCategory) { icon: emojiRecent; }
|
emojiCategoryRecent: IconButton(emojiCategory) { icon: emojiRecent; }
|
||||||
emojiCategoryPeople: IconButton(emojiCategory) { icon: emojiPeople; }
|
emojiCategoryPeople: IconButton(emojiCategory) { icon: emojiPeople; }
|
||||||
|
|
|
@ -208,13 +208,15 @@ void StickersListWidget::Footer::paintEvent(QPaintEvent *e) {
|
||||||
|
|
||||||
p.drawPixmapLeft(x + (st::emojiCategory.width - icon.pixw) / 2, _iconsTop + (st::emojiCategory.height - icon.pixh) / 2, width(), pix);
|
p.drawPixmapLeft(x + (st::emojiCategory.width - icon.pixw) / 2, _iconsTop + (st::emojiCategory.height - icon.pixh) / 2, width(), pix);
|
||||||
} else {
|
} else {
|
||||||
auto getSpecialSetIcon = [](uint64 setId, bool active) {
|
auto getSpecialSetIcon = [](uint64 setId) {
|
||||||
if (setId == Stickers::FeaturedSetId) {
|
if (setId == Stickers::FeaturedSetId) {
|
||||||
return active ? &st::stickersTrendingActive : &st::stickersTrending;
|
return &st::stickersTrending;
|
||||||
|
} else if (setId == Stickers::FavedSetId) {
|
||||||
|
return &st::stickersFaved;
|
||||||
}
|
}
|
||||||
return active ? &st::emojiRecentActive : &st::emojiRecent;
|
return &st::emojiRecent;
|
||||||
};
|
};
|
||||||
getSpecialSetIcon(icon.setId, false)->paint(p, x + st::emojiCategory.iconPosition.x(), _iconsTop + st::emojiCategory.iconPosition.y(), width());
|
getSpecialSetIcon(icon.setId)->paint(p, x + st::emojiCategory.iconPosition.x(), _iconsTop + st::emojiCategory.iconPosition.y(), width());
|
||||||
if (icon.setId == Stickers::FeaturedSetId) {
|
if (icon.setId == Stickers::FeaturedSetId) {
|
||||||
paintFeaturedStickerSetsBadge(p, x);
|
paintFeaturedStickerSetsBadge(p, x);
|
||||||
}
|
}
|
||||||
|
@ -1189,27 +1191,29 @@ void StickersListWidget::fillIcons(QList<StickerIcon> &icons) {
|
||||||
icons.push_back(StickerIcon(Stickers::FeaturedSetId));
|
icons.push_back(StickerIcon(Stickers::FeaturedSetId));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_mySets.isEmpty()) {
|
auto i = 0;
|
||||||
int i = 0;
|
if (i != _mySets.size() && _mySets[i].id == Stickers::RecentSetId) {
|
||||||
if (_mySets[0].id == Stickers::RecentSetId) {
|
++i;
|
||||||
++i;
|
icons.push_back(StickerIcon(Stickers::RecentSetId));
|
||||||
icons.push_back(StickerIcon(Stickers::RecentSetId));
|
}
|
||||||
}
|
if (i != _mySets.size() && _mySets[i].id == Stickers::FavedSetId) {
|
||||||
for (int l = _mySets.size(); i < l; ++i) {
|
++i;
|
||||||
auto s = _mySets[i].pack[0];
|
icons.push_back(StickerIcon(Stickers::FavedSetId));
|
||||||
int32 availw = st::emojiCategory.width - 2 * st::stickerIconPadding, availh = st::emojiCategory.height - 2 * st::stickerIconPadding;
|
}
|
||||||
int32 thumbw = s->thumb->width(), thumbh = s->thumb->height(), pixw = 1, pixh = 1;
|
for (auto l = _mySets.size(); i != l; ++i) {
|
||||||
if (availw * thumbh > availh * thumbw) {
|
auto s = _mySets[i].pack[0];
|
||||||
pixh = availh;
|
auto availw = st::emojiCategory.width - 2 * st::stickerIconPadding, availh = st::emojiCategory.height - 2 * st::stickerIconPadding;
|
||||||
pixw = (pixh * thumbw) / thumbh;
|
auto thumbw = s->thumb->width(), thumbh = s->thumb->height(), pixw = 1, pixh = 1;
|
||||||
} else {
|
if (availw * thumbh > availh * thumbw) {
|
||||||
pixw = availw;
|
pixh = availh;
|
||||||
pixh = thumbw ? ((pixw * thumbh) / thumbw) : 1;
|
pixw = (pixh * thumbw) / thumbh;
|
||||||
}
|
} else {
|
||||||
if (pixw < 1) pixw = 1;
|
pixw = availw;
|
||||||
if (pixh < 1) pixh = 1;
|
pixh = thumbw ? ((pixw * thumbh) / thumbw) : 1;
|
||||||
icons.push_back(StickerIcon(_mySets[i].id, s, pixw, pixh));
|
|
||||||
}
|
}
|
||||||
|
if (pixw < 1) pixw = 1;
|
||||||
|
if (pixh < 1) pixh = 1;
|
||||||
|
icons.push_back(StickerIcon(_mySets[i].id, s, pixw, pixh));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Global::FeaturedStickerSetsUnreadCount() && !_featuredSets.isEmpty()) {
|
if (!Global::FeaturedStickerSetsUnreadCount() && !_featuredSets.isEmpty()) {
|
||||||
|
|