diff --git a/Telegram/SourceFiles/chat_helpers/chat_helpers.style b/Telegram/SourceFiles/chat_helpers/chat_helpers.style index 9458fee5c..2a10d0a95 100644 --- a/Telegram/SourceFiles/chat_helpers/chat_helpers.style +++ b/Telegram/SourceFiles/chat_helpers/chat_helpers.style @@ -72,7 +72,7 @@ stickersTrendingSubheaderFg: windowSubTextFg; stickersTrendingSubheaderTop: 31px; emojiPanButtonRight: 7px; -emojiPanButtonTop: 10px; +emojiPanButtonTop: 0px; emojiPanButton: RoundButton(defaultActiveButton) { width: -24px; height: 23px; @@ -280,6 +280,7 @@ inlineResultsMaxHeight: 640px; emojiPanHeaderFont: semiboldFont; emojiPanRemoveSkip: 10px; +emojiPanRemoveTop: 2px; emojiColorsPadding: 5px; emojiColorsSep: 1px; @@ -312,7 +313,12 @@ stickerPanDeleteOpacityBg: 0.3; stickerPanDeleteOpacityBgOver: 0.5; stickerPanDeleteOpacityFg: 0.8; stickerPanDeleteOpacityFgOver: 1.; -stickerPanRemoveSet: hashtagClose; +stickerPanRemoveSet: IconButton(hashtagClose) { + width: 20px; + height: 20px; + iconPosition: point(-1px, -1px); + rippleAreaPosition: point(0px, 0px); +} stickerIconWidth: 42px; stickerIconPadding: 5px; stickerIconOpacity: 0.7; diff --git a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp index 0be861d18..392f271ed 100644 --- a/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp +++ b/Telegram/SourceFiles/chat_helpers/emoji_list_widget.cpp @@ -1531,7 +1531,7 @@ QRect EmojiListWidget::removeButtonRect(const SectionInfo &info) const { + st::stickerPanRemoveSet.rippleAreaSize; const auto buttonh = st::stickerPanRemoveSet.height; 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); } @@ -1971,12 +1971,16 @@ int EmojiListWidget::paintButtonGetWidth( custom.ripple.reset(); } } - (selected + const auto &icon = selected ? st::stickerPanRemoveSet.iconOver - : st::stickerPanRemoveSet.icon).paint( - p, - remove.topLeft() + st::stickerPanRemoveSet.iconPosition, - width()); + : st::stickerPanRemoveSet.icon; + icon.paint( + p, + (remove.topLeft() + + QPoint( + remove.width() - icon.width(), + remove.height() - icon.height()) / 2), + width()); } return emojiRight() - remove.x(); } diff --git a/Telegram/SourceFiles/chat_helpers/stickers_list_footer.cpp b/Telegram/SourceFiles/chat_helpers/stickers_list_footer.cpp index fb93d7bd4..24981175d 100644 --- a/Telegram/SourceFiles/chat_helpers/stickers_list_footer.cpp +++ b/Telegram/SourceFiles/chat_helpers/stickers_list_footer.cpp @@ -1303,8 +1303,14 @@ void StickersListFooter::paintSetIcon( p.translate(-center); } } - prepareSetIcon(context, info, now, paused); - p.drawImage(info.adjustedLeft, _iconsTop, _setIconCache); + if (icon.sticker) { + 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 (icon.custom) { p.translate(-expandingShift);