mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix emoji picker button in boxes in non-default scale.
This commit is contained in:
parent
0e6d4291a2
commit
56c8327746
3 changed files with 24 additions and 13 deletions
|
@ -514,6 +514,7 @@ void Launcher::processArguments() {
|
||||||
? style::kScaleAuto
|
? style::kScaleAuto
|
||||||
: value;
|
: value;
|
||||||
}
|
}
|
||||||
|
gConfigScale = 110; AssertIsDebug();
|
||||||
}
|
}
|
||||||
|
|
||||||
int Launcher::executeApplication() {
|
int Launcher::executeApplication() {
|
||||||
|
|
|
@ -33,23 +33,26 @@ void EmojiButton::paintEvent(QPaintEvent *e) {
|
||||||
const auto loadingState = _loading
|
const auto loadingState = _loading
|
||||||
? _loading->computeState()
|
? _loading->computeState()
|
||||||
: RadialState{ 0., 0, RadialState::kFull };
|
: RadialState{ 0., 0, RadialState::kFull };
|
||||||
|
const auto icon = _iconOverride ? _iconOverride : &(over ? _st.iconOver : _st.icon);
|
||||||
|
auto position = _st.iconPosition;
|
||||||
|
if (position.x() < 0) {
|
||||||
|
position.setX((width() - icon->width()) / 2);
|
||||||
|
}
|
||||||
|
if (position.y() < 0) {
|
||||||
|
position.setY((height() - icon->height()) / 2);
|
||||||
|
}
|
||||||
|
const auto skipx = icon->width() / 4;
|
||||||
|
const auto skipy = icon->height() / 4;
|
||||||
|
const auto inner = QRect(
|
||||||
|
position + QPoint(skipx, skipy),
|
||||||
|
QSize(icon->width() - 2 * skipx, icon->height() - 2 * skipy));
|
||||||
|
|
||||||
if (loadingState.shown < 1.) {
|
if (loadingState.shown < 1.) {
|
||||||
p.setOpacity(1. - loadingState.shown);
|
p.setOpacity(1. - loadingState.shown);
|
||||||
|
|
||||||
const auto icon = _iconOverride ? _iconOverride : &(over ? _st.iconOver : _st.icon);
|
|
||||||
auto position = _st.iconPosition;
|
|
||||||
if (position.x() < 0) {
|
|
||||||
position.setX((width() - icon->width()) / 2);
|
|
||||||
}
|
|
||||||
if (position.y() < 0) {
|
|
||||||
position.setY((height() - icon->height()) / 2);
|
|
||||||
}
|
|
||||||
icon->paint(p, position, width());
|
icon->paint(p, position, width());
|
||||||
|
|
||||||
p.setOpacity(1.);
|
p.setOpacity(1.);
|
||||||
}
|
}
|
||||||
|
|
||||||
QRect inner(QPoint((width() - st::historyEmojiCircle.width()) / 2, (height() - st::historyEmojiCircle.height()) / 2), st::historyEmojiCircle);
|
|
||||||
const auto color = (_colorOverride
|
const auto color = (_colorOverride
|
||||||
? *_colorOverride
|
? *_colorOverride
|
||||||
: (over
|
: (over
|
||||||
|
|
|
@ -505,10 +505,11 @@ void Generator::paintComposeArea() {
|
||||||
const auto emojiIconTop = (st::historyAttachEmoji.iconPosition.y() < 0)
|
const auto emojiIconTop = (st::historyAttachEmoji.iconPosition.y() < 0)
|
||||||
? ((st::historyAttachEmoji.height - st::historyAttachEmoji.icon.height()) / 2)
|
? ((st::historyAttachEmoji.height - st::historyAttachEmoji.icon.height()) / 2)
|
||||||
: st::historyAttachEmoji.iconPosition.y();
|
: st::historyAttachEmoji.iconPosition.y();
|
||||||
|
const auto &emojiIcon = st::historyAttachEmoji.icon[_palette];
|
||||||
right += st::historyAttachEmoji.width;
|
right += st::historyAttachEmoji.width;
|
||||||
auto attachEmojiLeft = _composeArea.x() + _composeArea.width() - right;
|
auto attachEmojiLeft = _composeArea.x() + _composeArea.width() - right;
|
||||||
_p->fillRect(attachEmojiLeft, controlsTop, st::historyAttachEmoji.width, st::historyAttachEmoji.height, st::historyComposeAreaBg[_palette]);
|
_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;
|
auto pen = st::historyEmojiCircleFg[_palette]->p;
|
||||||
pen.setWidth(st::historyEmojiCircleLine);
|
pen.setWidth(st::historyEmojiCircleLine);
|
||||||
|
@ -517,7 +518,13 @@ void Generator::paintComposeArea() {
|
||||||
_p->setBrush(Qt::NoBrush);
|
_p->setBrush(Qt::NoBrush);
|
||||||
|
|
||||||
PainterHighQualityEnabler hq(*_p);
|
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);
|
_p->drawEllipse(inner);
|
||||||
|
|
||||||
auto fieldLeft = _composeArea.x() + st::historyAttach.width;
|
auto fieldLeft = _composeArea.x() + st::historyAttach.width;
|
||||||
|
|
Loading…
Add table
Reference in a new issue