Fix colors for colorized stories reactions.

This commit is contained in:
John Preston 2023-08-08 15:46:54 +02:00
parent e6ad367c55
commit 2dfaf27884
5 changed files with 13 additions and 4 deletions

View File

@ -354,6 +354,7 @@ struct IconSelector {
&owner->reactions(),
std::move(args),
[=] { state->animation->repaint(); },
[] { return st::windowFg->c; },
Data::CustomEmojiSizeTag::Large);
}
state->iconId = id;

View File

@ -229,6 +229,7 @@ void EmojiStatusPanel::startAnimation(
&owner->reactions(),
std::move(args),
[=] { _animation->repaint(); },
[] { return st::profileVerifiedCheckBg->c; },
_animationSizeTag);
}

View File

@ -556,12 +556,12 @@ void Reactions::initLikeIcon(
target.y() + (target.height() - inner) / 2,
inner,
inner);
p.drawImage(rect, icon->frame(st::windowFg->c));
p.drawImage(rect, icon->frame(st::storiesComposeWhiteText->c));
} else {
const auto customSize = fly->center.customSize;
const auto scaled = (inner != customSize);
fly->center.custom->paint(p, {
.textColor = st::windowFg->c,
.textColor = st::storiesComposeWhiteText->c,
.size = { customSize, customSize },
.now = crl::now(),
.scale = (scaled ? (inner / float64(customSize)) : 1.),
@ -650,11 +650,13 @@ void Reactions::setLikedId(
bool force) {
if (const auto done = setLikedIdIconInit(owner, id, force)) {
const auto reactions = &owner->reactions();
const auto colored = [] { return st::storiesComposeWhiteText->c; };
const auto sizeTag = Data::CustomEmojiSizeTag::Isolated;
done(Ui::EmojiFlyAnimation(_controller->wrap(), reactions, {
.id = id,
.scaleOutDuration = kReactionScaleOutDuration,
.scaleOutTarget = kReactionScaleOutTarget,
}, [] {}, Data::CustomEmojiSizeTag::Isolated).grabBadgeCenter());
}, [] {}, colored, sizeTag).grabBadgeCenter());
}
}
@ -669,6 +671,7 @@ void Reactions::startReactionAnimation(
&story->owner().reactions(),
std::move(args),
[=] { _reactionAnimation->repaint(); },
[] { return st::storiesComposeWhiteText->c; },
Data::CustomEmojiSizeTag::Isolated);
const auto layer = _reactionAnimation->layer();
wrap->paintRequest() | rpl::start_with_next([=] {

View File

@ -33,8 +33,10 @@ EmojiFlyAnimation::EmojiFlyAnimation(
not_null<Data::Reactions*> owner,
ReactionFlyAnimationArgs &&args,
Fn<void()> repaint,
Fn<QColor()> textColor,
Data::CustomEmojiSizeTag tag)
: _flySize(ComputeFlySize(tag))
, _textColor(std::move(textColor))
, _fly(
owner,
std::move(args),
@ -63,7 +65,7 @@ EmojiFlyAnimation::EmojiFlyAnimation(
QRect(
rect.topLeft() + QPoint(skipx, skipy),
QSize(_flySize, _flySize)),
st::infoPeerBadge.premiumFg->c,
_textColor(),
clip,
crl::now());
if (_areaUpdated || _area.isEmpty()) {

View File

@ -21,6 +21,7 @@ public:
not_null<Data::Reactions*> owner,
Ui::ReactionFlyAnimationArgs &&args,
Fn<void()> repaint,
Fn<QColor()> textColor,
Data::CustomEmojiSizeTag tag);
[[nodiscard]] not_null<Ui::RpWidget*> layer();
@ -32,6 +33,7 @@ public:
private:
const int _flySize = 0;
Fn<QColor()> _textColor;
Ui::ReactionFlyAnimation _fly;
Ui::RpWidget _layer;
QRect _area;