From dfaf378ab8b7ba9abb55e464997e538eeeafc14e Mon Sep 17 00:00:00 2001 From: John Preston Date: Thu, 7 May 2026 18:32:50 +0400 Subject: [PATCH] Fix possible glitch in chats list typing animation. --- .../SourceFiles/dialogs/ui/dialogs_layout.cpp | 17 +++++++++++++---- .../history/view/history_view_send_action.cpp | 9 +-------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp b/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp index c620ec32a2..e8e88862b0 100644 --- a/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp +++ b/Telegram/SourceFiles/dialogs/ui/dialogs_layout.cpp @@ -1309,11 +1309,20 @@ QRect RowPainter::SendActionAnimationRect( const auto nameleft = st.nameLeft; const auto namewidth = fullWidth - nameleft - st.padding.right(); const auto texttop = st.textTop; + + const auto add = st::lineWidth - Ui::Emoji::GetCustomSkipNormal(); + const auto height = std::max({ + add + rect.height() + add, + add + st::normalFont->height + add, + add + st::dialogsMiniPreviewTop + st::dialogsMiniPreview + add, + st::lineWidth + Ui::Emoji::GetCustomSizeNormal() + st::lineWidth, + }); + return QRect( - nameleft + (textUpdated ? 0 : rect.x()), - texttop + rect.y(), - textUpdated ? namewidth : rect.width(), - rect.height()); + nameleft + (textUpdated ? (-add) : rect.x()), + texttop + rect.y() - add, + textUpdated ? (add + namewidth + add) : rect.width(), + height); } void PaintCollapsedRow( diff --git a/Telegram/SourceFiles/history/view/history_view_send_action.cpp b/Telegram/SourceFiles/history/view/history_view_send_action.cpp index f4e386e818..82ca693205 100644 --- a/Telegram/SourceFiles/history/view/history_view_send_action.cpp +++ b/Telegram/SourceFiles/history/view/history_view_send_action.cpp @@ -387,17 +387,10 @@ bool SendActionPainter::updateNeedsAnimating(crl::time now, bool force) { if (force || sendActionChanged || (sendActionResult && !anim::Disabled())) { - const auto left = 0; - const auto top = Ui::Emoji::GetCustomSkipNormal(); const auto width = _sendActionAnimation.width() + _animationLeft; - const auto height = std::max({ - st::normalFont->height - top, - st::dialogsMiniPreviewTop + st::dialogsMiniPreview - top, - Ui::Emoji::GetCustomSizeNormal(), - }); _history->peer->owner().sendActionManager().updateAnimation({ _topic ? ((Data::Thread*)_topic) : _history, - { left, top, width, height }, + { 0, 0, width, st::normalFont->height }, (force || sendActionChanged) }); }