mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Improve clearing of reaction animations.
This commit is contained in:
parent
490e688a91
commit
928d8feb21
2 changed files with 10 additions and 3 deletions
|
@ -239,10 +239,12 @@ void BottomInfo::paintReactions(
|
||||||
auto x = left;
|
auto x = left;
|
||||||
auto y = top;
|
auto y = top;
|
||||||
auto widthLeft = availableWidth;
|
auto widthLeft = availableWidth;
|
||||||
const auto animated = (_reactionAnimation && context.reactionEffects)
|
const auto animated = _reactionAnimation
|
||||||
? _reactionAnimation->playingAroundEmoji()
|
? _reactionAnimation->playingAroundEmoji()
|
||||||
: QString();
|
: QString();
|
||||||
if (_reactionAnimation && animated.isEmpty()) {
|
if (_reactionAnimation
|
||||||
|
&& context.reactionEffects
|
||||||
|
&& animated.isEmpty()) {
|
||||||
_reactionAnimation = nullptr;
|
_reactionAnimation = nullptr;
|
||||||
}
|
}
|
||||||
for (const auto &reaction : _reactions) {
|
for (const auto &reaction : _reactions) {
|
||||||
|
@ -361,6 +363,11 @@ void BottomInfo::layoutRepliesText() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void BottomInfo::layoutReactionsText() {
|
void BottomInfo::layoutReactionsText() {
|
||||||
|
if (_reactionAnimation
|
||||||
|
&& !_data.reactions.contains(
|
||||||
|
_reactionAnimation->playingAroundEmoji())) {
|
||||||
|
_reactionAnimation = nullptr;
|
||||||
|
}
|
||||||
if (_data.reactions.empty()) {
|
if (_data.reactions.empty()) {
|
||||||
_reactions.clear();
|
_reactions.clear();
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -193,7 +193,7 @@ void InlineList::paint(
|
||||||
const auto animated = (_animation && context.reactionEffects)
|
const auto animated = (_animation && context.reactionEffects)
|
||||||
? _animation->playingAroundEmoji()
|
? _animation->playingAroundEmoji()
|
||||||
: QString();
|
: QString();
|
||||||
if (_animation && animated.isEmpty()) {
|
if (_animation && context.reactionEffects && animated.isEmpty()) {
|
||||||
_animation = nullptr;
|
_animation = nullptr;
|
||||||
}
|
}
|
||||||
p.setFont(st::semiboldFont);
|
p.setFont(st::semiboldFont);
|
||||||
|
|
Loading…
Add table
Reference in a new issue