From fe73bf905384712dcbbb03af3eceb359a7c09db0 Mon Sep 17 00:00:00 2001 From: John Preston Date: Tue, 16 Apr 2024 12:49:23 +0400 Subject: [PATCH] Fix ripples in channel comments buttons. --- .../history/view/history_view_message.cpp | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Telegram/SourceFiles/history/view/history_view_message.cpp b/Telegram/SourceFiles/history/view/history_view_message.cpp index 2a7ee708dc..67f10c0336 100644 --- a/Telegram/SourceFiles/history/view/history_view_message.cpp +++ b/Telegram/SourceFiles/history/view/history_view_message.cpp @@ -1843,27 +1843,27 @@ void Message::clickHandlerPressedChanged( Element::clickHandlerPressedChanged(handler, pressed); if (!handler) { return; - } else if (_rightAction) { - if (_rightAction->second && (handler == _rightAction->second->link)) { - const auto rightSize = rightActionSize(); - Assert(rightSize != std::nullopt); - if (pressed) { - if (!_rightAction->second->ripple) { - // Create a ripple. - _rightAction->second->ripple - = std::make_unique( - st::defaultRippleAnimation, - Ui::RippleAnimation::RoundRectMask( - Size(rightSize->width()), - rightSize->width() / 2), - [=] { repaint(); }); - } - _rightAction->second->ripple->add(_rightAction->lastPoint); - } else if (_rightAction->second->ripple) { - _rightAction->second->ripple->lastStop(); + } else if (_rightAction && (handler == _rightAction->link)) { + toggleRightActionRipple(pressed); + } else if (_rightAction + && _rightAction->second + && (handler == _rightAction->second->link)) { + const auto rightSize = rightActionSize(); + Assert(rightSize != std::nullopt); + if (pressed) { + if (!_rightAction->second->ripple) { + // Create a ripple. + _rightAction->second->ripple + = std::make_unique( + st::defaultRippleAnimation, + Ui::RippleAnimation::RoundRectMask( + Size(rightSize->width()), + rightSize->width() / 2), + [=] { repaint(); }); } - } else if (handler == _rightAction->link) { - toggleRightActionRipple(pressed); + _rightAction->second->ripple->add(_rightAction->lastPoint); + } else if (_rightAction->second->ripple) { + _rightAction->second->ripple->lastStop(); } } else if (_comments && (handler == _comments->link)) { toggleCommentsButtonRipple(pressed);