2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-31 14:38:15 +00:00

Fix emoji picker button in boxes in non-default scale.

This commit is contained in:
John Preston
2021-03-22 19:40:56 +04:00
parent 0e6d4291a2
commit 56c8327746
3 changed files with 24 additions and 13 deletions

View File

@@ -505,10 +505,11 @@ void Generator::paintComposeArea() {
const auto emojiIconTop = (st::historyAttachEmoji.iconPosition.y() < 0)
? ((st::historyAttachEmoji.height - st::historyAttachEmoji.icon.height()) / 2)
: st::historyAttachEmoji.iconPosition.y();
const auto &emojiIcon = st::historyAttachEmoji.icon[_palette];
right += st::historyAttachEmoji.width;
auto attachEmojiLeft = _composeArea.x() + _composeArea.width() - right;
_p->fillRect(attachEmojiLeft, controlsTop, st::historyAttachEmoji.width, st::historyAttachEmoji.height, st::historyComposeAreaBg[_palette]);
st::historyAttachEmoji.icon[_palette].paint(*_p, attachEmojiLeft + emojiIconLeft, controlsTop + emojiIconTop, _rect.width());
emojiIcon.paint(*_p, attachEmojiLeft + emojiIconLeft, controlsTop + emojiIconTop, _rect.width());
auto pen = st::historyEmojiCircleFg[_palette]->p;
pen.setWidth(st::historyEmojiCircleLine);
@@ -517,7 +518,13 @@ void Generator::paintComposeArea() {
_p->setBrush(Qt::NoBrush);
PainterHighQualityEnabler hq(*_p);
auto inner = QRect(QPoint(attachEmojiLeft + (st::historyAttachEmoji.width - st::historyEmojiCircle.width()) / 2, controlsTop + st::historyEmojiCircleTop), st::historyEmojiCircle);
const auto skipx = emojiIcon.width() / 4;
const auto skipy = emojiIcon.height() / 4;
const auto inner = QRect(
attachEmojiLeft + emojiIconLeft + skipx,
controlsTop + emojiIconTop + skipy,
emojiIcon.width() - 2 * skipx,
emojiIcon.height() - 2 * skipy);
_p->drawEllipse(inner);
auto fieldLeft = _composeArea.x() + st::historyAttach.width;