mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Fixed position of send action animation.
This commit is contained in:
parent
0f28069881
commit
92b7afc5f5
1 changed files with 5 additions and 3 deletions
|
@ -221,6 +221,7 @@ bool SendActionPainter::updateNeedsAnimating(crl::time now, bool force) {
|
||||||
const auto wasSpeakingAnimation = !!_speakingAnimation;
|
const auto wasSpeakingAnimation = !!_speakingAnimation;
|
||||||
if (force || sendActionChanged || speakingChanged) {
|
if (force || sendActionChanged || speakingChanged) {
|
||||||
QString newTypingString;
|
QString newTypingString;
|
||||||
|
auto animationLeft = 0;
|
||||||
auto typingCount = _typing.size();
|
auto typingCount = _typing.size();
|
||||||
if (typingCount > 2) {
|
if (typingCount > 2) {
|
||||||
newTypingString = tr::lng_many_typing(tr::now, lt_count, typingCount);
|
newTypingString = tr::lng_many_typing(tr::now, lt_count, typingCount);
|
||||||
|
@ -295,7 +296,7 @@ bool SendActionPainter::updateNeedsAnimating(crl::time now, bool force) {
|
||||||
const auto index = newTypingString.size()
|
const auto index = newTypingString.size()
|
||||||
- lang.rightIndexChoosingStickerReplacement(
|
- lang.rightIndexChoosingStickerReplacement(
|
||||||
isNamed);
|
isNamed);
|
||||||
_animationLeft = _st.font->width(
|
animationLeft = _st.font->width(
|
||||||
newTypingString,
|
newTypingString,
|
||||||
0,
|
0,
|
||||||
index);
|
index);
|
||||||
|
@ -310,8 +311,6 @@ bool SendActionPainter::updateNeedsAnimating(crl::time now, bool force) {
|
||||||
Lang::kChoosingStickerReplacement.utf8().size(),
|
Lang::kChoosingStickerReplacement.utf8().size(),
|
||||||
QString().fill(' ', _spacesCount).constData(),
|
QString().fill(' ', _spacesCount).constData(),
|
||||||
_spacesCount);
|
_spacesCount);
|
||||||
} else {
|
|
||||||
_animationLeft = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -356,6 +355,9 @@ bool SendActionPainter::updateNeedsAnimating(crl::time now, bool force) {
|
||||||
_sendActionString,
|
_sendActionString,
|
||||||
Ui::NameTextOptions());
|
Ui::NameTextOptions());
|
||||||
}
|
}
|
||||||
|
if (_animationLeft != animationLeft) {
|
||||||
|
_animationLeft = animationLeft;
|
||||||
|
}
|
||||||
if (_speaking.empty()) {
|
if (_speaking.empty()) {
|
||||||
_speakingAnimation.tryToFinish();
|
_speakingAnimation.tryToFinish();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue