mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fix colors for colorized stories reactions.
This commit is contained in:
parent
e6ad367c55
commit
2dfaf27884
5 changed files with 13 additions and 4 deletions
|
@ -354,6 +354,7 @@ struct IconSelector {
|
||||||
&owner->reactions(),
|
&owner->reactions(),
|
||||||
std::move(args),
|
std::move(args),
|
||||||
[=] { state->animation->repaint(); },
|
[=] { state->animation->repaint(); },
|
||||||
|
[] { return st::windowFg->c; },
|
||||||
Data::CustomEmojiSizeTag::Large);
|
Data::CustomEmojiSizeTag::Large);
|
||||||
}
|
}
|
||||||
state->iconId = id;
|
state->iconId = id;
|
||||||
|
|
|
@ -229,6 +229,7 @@ void EmojiStatusPanel::startAnimation(
|
||||||
&owner->reactions(),
|
&owner->reactions(),
|
||||||
std::move(args),
|
std::move(args),
|
||||||
[=] { _animation->repaint(); },
|
[=] { _animation->repaint(); },
|
||||||
|
[] { return st::profileVerifiedCheckBg->c; },
|
||||||
_animationSizeTag);
|
_animationSizeTag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -556,12 +556,12 @@ void Reactions::initLikeIcon(
|
||||||
target.y() + (target.height() - inner) / 2,
|
target.y() + (target.height() - inner) / 2,
|
||||||
inner,
|
inner,
|
||||||
inner);
|
inner);
|
||||||
p.drawImage(rect, icon->frame(st::windowFg->c));
|
p.drawImage(rect, icon->frame(st::storiesComposeWhiteText->c));
|
||||||
} else {
|
} else {
|
||||||
const auto customSize = fly->center.customSize;
|
const auto customSize = fly->center.customSize;
|
||||||
const auto scaled = (inner != customSize);
|
const auto scaled = (inner != customSize);
|
||||||
fly->center.custom->paint(p, {
|
fly->center.custom->paint(p, {
|
||||||
.textColor = st::windowFg->c,
|
.textColor = st::storiesComposeWhiteText->c,
|
||||||
.size = { customSize, customSize },
|
.size = { customSize, customSize },
|
||||||
.now = crl::now(),
|
.now = crl::now(),
|
||||||
.scale = (scaled ? (inner / float64(customSize)) : 1.),
|
.scale = (scaled ? (inner / float64(customSize)) : 1.),
|
||||||
|
@ -650,11 +650,13 @@ void Reactions::setLikedId(
|
||||||
bool force) {
|
bool force) {
|
||||||
if (const auto done = setLikedIdIconInit(owner, id, force)) {
|
if (const auto done = setLikedIdIconInit(owner, id, force)) {
|
||||||
const auto reactions = &owner->reactions();
|
const auto reactions = &owner->reactions();
|
||||||
|
const auto colored = [] { return st::storiesComposeWhiteText->c; };
|
||||||
|
const auto sizeTag = Data::CustomEmojiSizeTag::Isolated;
|
||||||
done(Ui::EmojiFlyAnimation(_controller->wrap(), reactions, {
|
done(Ui::EmojiFlyAnimation(_controller->wrap(), reactions, {
|
||||||
.id = id,
|
.id = id,
|
||||||
.scaleOutDuration = kReactionScaleOutDuration,
|
.scaleOutDuration = kReactionScaleOutDuration,
|
||||||
.scaleOutTarget = kReactionScaleOutTarget,
|
.scaleOutTarget = kReactionScaleOutTarget,
|
||||||
}, [] {}, Data::CustomEmojiSizeTag::Isolated).grabBadgeCenter());
|
}, [] {}, colored, sizeTag).grabBadgeCenter());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -669,6 +671,7 @@ void Reactions::startReactionAnimation(
|
||||||
&story->owner().reactions(),
|
&story->owner().reactions(),
|
||||||
std::move(args),
|
std::move(args),
|
||||||
[=] { _reactionAnimation->repaint(); },
|
[=] { _reactionAnimation->repaint(); },
|
||||||
|
[] { return st::storiesComposeWhiteText->c; },
|
||||||
Data::CustomEmojiSizeTag::Isolated);
|
Data::CustomEmojiSizeTag::Isolated);
|
||||||
const auto layer = _reactionAnimation->layer();
|
const auto layer = _reactionAnimation->layer();
|
||||||
wrap->paintRequest() | rpl::start_with_next([=] {
|
wrap->paintRequest() | rpl::start_with_next([=] {
|
||||||
|
|
|
@ -33,8 +33,10 @@ EmojiFlyAnimation::EmojiFlyAnimation(
|
||||||
not_null<Data::Reactions*> owner,
|
not_null<Data::Reactions*> owner,
|
||||||
ReactionFlyAnimationArgs &&args,
|
ReactionFlyAnimationArgs &&args,
|
||||||
Fn<void()> repaint,
|
Fn<void()> repaint,
|
||||||
|
Fn<QColor()> textColor,
|
||||||
Data::CustomEmojiSizeTag tag)
|
Data::CustomEmojiSizeTag tag)
|
||||||
: _flySize(ComputeFlySize(tag))
|
: _flySize(ComputeFlySize(tag))
|
||||||
|
, _textColor(std::move(textColor))
|
||||||
, _fly(
|
, _fly(
|
||||||
owner,
|
owner,
|
||||||
std::move(args),
|
std::move(args),
|
||||||
|
@ -63,7 +65,7 @@ EmojiFlyAnimation::EmojiFlyAnimation(
|
||||||
QRect(
|
QRect(
|
||||||
rect.topLeft() + QPoint(skipx, skipy),
|
rect.topLeft() + QPoint(skipx, skipy),
|
||||||
QSize(_flySize, _flySize)),
|
QSize(_flySize, _flySize)),
|
||||||
st::infoPeerBadge.premiumFg->c,
|
_textColor(),
|
||||||
clip,
|
clip,
|
||||||
crl::now());
|
crl::now());
|
||||||
if (_areaUpdated || _area.isEmpty()) {
|
if (_areaUpdated || _area.isEmpty()) {
|
||||||
|
|
|
@ -21,6 +21,7 @@ public:
|
||||||
not_null<Data::Reactions*> owner,
|
not_null<Data::Reactions*> owner,
|
||||||
Ui::ReactionFlyAnimationArgs &&args,
|
Ui::ReactionFlyAnimationArgs &&args,
|
||||||
Fn<void()> repaint,
|
Fn<void()> repaint,
|
||||||
|
Fn<QColor()> textColor,
|
||||||
Data::CustomEmojiSizeTag tag);
|
Data::CustomEmojiSizeTag tag);
|
||||||
|
|
||||||
[[nodiscard]] not_null<Ui::RpWidget*> layer();
|
[[nodiscard]] not_null<Ui::RpWidget*> layer();
|
||||||
|
@ -32,6 +33,7 @@ public:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const int _flySize = 0;
|
const int _flySize = 0;
|
||||||
|
Fn<QColor()> _textColor;
|
||||||
Ui::ReactionFlyAnimation _fly;
|
Ui::ReactionFlyAnimation _fly;
|
||||||
Ui::RpWidget _layer;
|
Ui::RpWidget _layer;
|
||||||
QRect _area;
|
QRect _area;
|
||||||
|
|
Loading…
Add table
Reference in a new issue