Beta version 3.6.3: Fix emoji in ReactionsSettingsBox on non-Retina.

This commit is contained in:
John Preston 2022-04-14 09:45:52 +04:00
parent 59fc9d3bfd
commit 5cf3b621ee
3 changed files with 20 additions and 18 deletions

View file

@ -206,12 +206,14 @@ void AddMessage(
view->draw(p, context);
}, widget->lifetime());
rpl::duplicate(
emojiValue
) | rpl::start_with_next([=,
emojiValue = std::move(emojiValue),
iconSize = st::settingsReactionMessageSize](
const QString &emoji) {
auto selectedEmoji = rpl::duplicate(emojiValue);
std::move(
selectedEmoji
) | rpl::start_with_next([
=,
emojiValue = std::move(emojiValue),
iconSize = st::settingsReactionMessageSize
](const QString &emoji) {
const auto &reactions = controller->session().data().reactions();
for (const auto &r : reactions.list(Data::Reactions::Type::All)) {
if (emoji != r.emoji) {
@ -308,8 +310,7 @@ void AddReactionLottieIcon(
const auto update = crl::guard(widget, [=] { widget->update(); });
widget->paintRequest(
) | rpl::start_with_next([=,
frameSize = (iconSize / style::DevicePixelRatio())] {
) | rpl::start_with_next([=] {
Painter p(widget);
if (state->finalAnimation.animating()) {
@ -328,10 +329,10 @@ void AddReactionLottieIcon(
const auto frame = animation->frame();
p.drawImage(
QRect(
(widget->width() - frameSize) / 2,
(widget->height() - frameSize) / 2,
frameSize,
frameSize),
(widget->width() - iconSize) / 2,
(widget->height() - iconSize) / 2,
iconSize,
iconSize),
frame);
};

View file

@ -370,13 +370,13 @@ settingsPeerToPeerSkip: 9px;
settingsIconRadius: 6px;
settingsReactionSize: 50px;
settingsReactionRightSkip: -10px;
settingsReactionSize: 25px;
settingsReactionRightSkip: 0px;
settingsReactionCornerSize: size(28px, 22px);
settingsReactionCornerSkip: point(11px, -6px);
settingsReactionMessageSize: 36px;
settingsReactionMessageSize: 18px;
settingsReactionRightIcon: 40px;
settingsReactionRightIcon: 20px;
notifyPreviewMargins: margins(40px, 20px, 40px, 58px);
notifyPreviewUserpicSize: 36px;

View file

@ -881,8 +881,9 @@ void SetupMessages(
) | rpl::filter([](const QString &emoji) {
return !emoji.isEmpty();
});
rpl::duplicate(
emojiValue
auto selectedEmoji = rpl::duplicate(emojiValue);
std::move(
selectedEmoji
) | rpl::start_with_next([=, emojiValue = std::move(emojiValue)](
const QString &emoji) {
const auto &reactions = controller->session().data().reactions();