Fix emoji set right buttons.

This commit is contained in:
John Preston 2023-01-24 09:32:27 +04:00
parent f19e343025
commit 04482ef33b
3 changed files with 26 additions and 10 deletions

View file

@ -72,7 +72,7 @@ stickersTrendingSubheaderFg: windowSubTextFg;
stickersTrendingSubheaderTop: 31px; stickersTrendingSubheaderTop: 31px;
emojiPanButtonRight: 7px; emojiPanButtonRight: 7px;
emojiPanButtonTop: 10px; emojiPanButtonTop: 0px;
emojiPanButton: RoundButton(defaultActiveButton) { emojiPanButton: RoundButton(defaultActiveButton) {
width: -24px; width: -24px;
height: 23px; height: 23px;
@ -280,6 +280,7 @@ inlineResultsMaxHeight: 640px;
emojiPanHeaderFont: semiboldFont; emojiPanHeaderFont: semiboldFont;
emojiPanRemoveSkip: 10px; emojiPanRemoveSkip: 10px;
emojiPanRemoveTop: 2px;
emojiColorsPadding: 5px; emojiColorsPadding: 5px;
emojiColorsSep: 1px; emojiColorsSep: 1px;
@ -312,7 +313,12 @@ stickerPanDeleteOpacityBg: 0.3;
stickerPanDeleteOpacityBgOver: 0.5; stickerPanDeleteOpacityBgOver: 0.5;
stickerPanDeleteOpacityFg: 0.8; stickerPanDeleteOpacityFg: 0.8;
stickerPanDeleteOpacityFgOver: 1.; stickerPanDeleteOpacityFgOver: 1.;
stickerPanRemoveSet: hashtagClose; stickerPanRemoveSet: IconButton(hashtagClose) {
width: 20px;
height: 20px;
iconPosition: point(-1px, -1px);
rippleAreaPosition: point(0px, 0px);
}
stickerIconWidth: 42px; stickerIconWidth: 42px;
stickerIconPadding: 5px; stickerIconPadding: 5px;
stickerIconOpacity: 0.7; stickerIconOpacity: 0.7;

View file

@ -1531,7 +1531,7 @@ QRect EmojiListWidget::removeButtonRect(const SectionInfo &info) const {
+ st::stickerPanRemoveSet.rippleAreaSize; + st::stickerPanRemoveSet.rippleAreaSize;
const auto buttonh = st::stickerPanRemoveSet.height; const auto buttonh = st::stickerPanRemoveSet.height;
const auto buttonx = emojiRight() - st::emojiPanRemoveSkip - buttonw; const auto buttonx = emojiRight() - st::emojiPanRemoveSkip - buttonw;
const auto buttony = info.top + (st().header - buttonh) / 2; const auto buttony = info.top + st::emojiPanRemoveTop;
return QRect(buttonx, buttony, buttonw, buttonh); return QRect(buttonx, buttony, buttonw, buttonh);
} }
@ -1971,12 +1971,16 @@ int EmojiListWidget::paintButtonGetWidth(
custom.ripple.reset(); custom.ripple.reset();
} }
} }
(selected const auto &icon = selected
? st::stickerPanRemoveSet.iconOver ? st::stickerPanRemoveSet.iconOver
: st::stickerPanRemoveSet.icon).paint( : st::stickerPanRemoveSet.icon;
p, icon.paint(
remove.topLeft() + st::stickerPanRemoveSet.iconPosition, p,
width()); (remove.topLeft()
+ QPoint(
remove.width() - icon.width(),
remove.height() - icon.height()) / 2),
width());
} }
return emojiRight() - remove.x(); return emojiRight() - remove.x();
} }

View file

@ -1303,8 +1303,14 @@ void StickersListFooter::paintSetIcon(
p.translate(-center); p.translate(-center);
} }
} }
prepareSetIcon(context, info, now, paused); if (icon.sticker) {
p.drawImage(info.adjustedLeft, _iconsTop, _setIconCache); prepareSetIcon(context, info, now, paused);
p.drawImage(info.adjustedLeft, _iconsTop, _setIconCache);
} else {
p.translate(info.adjustedLeft, _iconsTop);
paintSetIconToCache(p, context, info, now, paused);
p.translate(-info.adjustedLeft, -_iconsTop);
}
if (context.expanding) { if (context.expanding) {
if (icon.custom) { if (icon.custom) {
p.translate(-expandingShift); p.translate(-expandingShift);