Support colorized emoji in reactions fly animation.

This commit is contained in:
John Preston 2023-04-24 14:56:10 +04:00
parent 2dea8941a5
commit 4cfa486d91

View File

@ -324,6 +324,7 @@ void InlineList::paint(
const QRect &clip) const { const QRect &clip) const {
struct SingleAnimation { struct SingleAnimation {
not_null<Ui::ReactionFlyAnimation*> animation; not_null<Ui::ReactionFlyAnimation*> animation;
QColor textColor;
QRect target; QRect target;
}; };
std::vector<SingleAnimation> animations; std::vector<SingleAnimation> animations;
@ -396,6 +397,7 @@ void InlineList::paint(
button.id, button.id,
::Data::Reactions::ImageSize::InlineList); ::Data::Reactions::ImageSize::InlineList);
} }
const auto textFg = !inbubble const auto textFg = !inbubble
? (chosen ? (chosen
? QPen(AdaptChosenServiceFg(st->msgServiceBg()->c)) ? QPen(AdaptChosenServiceFg(st->msgServiceBg()->c))
@ -427,6 +429,7 @@ void InlineList::paint(
if (animating) { if (animating) {
animations.push_back({ animations.push_back({
.animation = button.animation.get(), .animation = button.animation.get(),
.textColor = textFg.color(),
.target = image, .target = image,
}); });
} }
@ -465,7 +468,7 @@ void InlineList::paint(
p, p,
QPoint(), QPoint(),
single.target, single.target,
QColor(255, 255, 255, 0), // Colored, for emoji status. single.textColor,
QRect(), // Clip, for emoji status. QRect(), // Clip, for emoji status.
now); now);
result = result.isEmpty() ? area : result.united(area); result = result.isEmpty() ? area : result.united(area);