From 9d164dc33c2b16c0bcf43fb6153152aaea80b1a8 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Fri, 11 Feb 2022 02:57:13 +0300 Subject: [PATCH] Added clearing of message sending animations on escape from section. --- Telegram/SourceFiles/history/history_widget.cpp | 1 + .../history/view/history_view_replies_section.cpp | 1 + .../ui/effects/message_sending_animation_controller.cpp | 5 +++++ .../ui/effects/message_sending_animation_controller.h | 2 ++ 4 files changed, 9 insertions(+) diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 7b8a7d9cc..41ea4e6e3 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -1988,6 +1988,7 @@ void HistoryWidget::showHistory( } clearHighlightMessages(); + controller()->sendingAnimation().clear(); hideInfoTooltip(anim::type::instant); if (_history) { if (_peer->id == peerId && !reload) { diff --git a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp index c8356bbc6..eeb56f75f 100644 --- a/Telegram/SourceFiles/history/view/history_view_replies_section.cpp +++ b/Telegram/SourceFiles/history/view/history_view_replies_section.cpp @@ -324,6 +324,7 @@ RepliesWidget::~RepliesWidget() { _history->owner().sendActionManager().repliesPainterRemoved( _history, _rootId); + controller()->sendingAnimation().clear(); } void RepliesWidget::orderWidgets() { diff --git a/Telegram/SourceFiles/ui/effects/message_sending_animation_controller.cpp b/Telegram/SourceFiles/ui/effects/message_sending_animation_controller.cpp index 07dcc639b..1ac9c7e7d 100644 --- a/Telegram/SourceFiles/ui/effects/message_sending_animation_controller.cpp +++ b/Telegram/SourceFiles/ui/effects/message_sending_animation_controller.cpp @@ -260,4 +260,9 @@ bool MessageSendingAnimationController::hasAnimatedMessage( return _processing.contains(item); } +void MessageSendingAnimationController::clear() { + _itemSendPending.clear(); + _processing.clear(); +} + } // namespace Ui diff --git a/Telegram/SourceFiles/ui/effects/message_sending_animation_controller.h b/Telegram/SourceFiles/ui/effects/message_sending_animation_controller.h index 7d51c616e..0e8bbfdaa 100644 --- a/Telegram/SourceFiles/ui/effects/message_sending_animation_controller.h +++ b/Telegram/SourceFiles/ui/effects/message_sending_animation_controller.h @@ -40,6 +40,8 @@ public: [[nodiscard]] bool hasLocalMessage(MsgId msgId) const; [[nodiscard]] bool hasAnimatedMessage(not_null item) const; + void clear(); + private: const not_null _controller;