From f9b5789cf727561012e5bd9288bc342f43b98164 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 14 Jan 2024 14:01:48 +0300 Subject: [PATCH] Fixed button position in voice record bar for ttl voice messages. --- .../controls/history_view_voice_record_bar.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp index 1f812250b..093e26bd9 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.cpp @@ -1325,6 +1325,7 @@ void VoiceRecordBar::init() { } updateTTLGeometry(TTLAnimationType::TopBottom, 1. - value); }; + _showListenAnimation.stop(); _showListenAnimation.start(std::move(callback), 0., to, duration); }, lifetime()); @@ -1456,13 +1457,18 @@ void VoiceRecordBar::setTTLFilter(FilterCallback &&callback) { } void VoiceRecordBar::initLockGeometry() { - rpl::combine( - _lock->heightValue(), - geometryValue(), - static_cast(parentWidget())->geometryValue() + const auto parent = static_cast(parentWidget()); + rpl::merge( + _lock->heightValue() | rpl::to_empty, + geometryValue() | rpl::to_empty, + parent->geometryValue() | rpl::to_empty ) | rpl::start_with_next([=] { updateLockGeometry(); }, lifetime()); + parent->geometryValue( + ) | rpl::start_with_next([=] { + updateTTLGeometry(TTLAnimationType::RightLeft, 1.); + }, lifetime()); } void VoiceRecordBar::initLevelGeometry() {