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 8a8c673ca..c6fd7bff4 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 @@ -1431,7 +1431,12 @@ void VoiceRecordBar::updateTTLGeometry( const auto parent = parentWidget(); const auto me = Ui::MapFrom(_outerContainer, parent, geometry()); const auto anyTop = me.y() - st::historyRecordLockPosition.y(); - const auto ttlFrom = anyTop - _ttlButton->height() * 2; + const auto lockHiddenProgress = (_lockShowing.current() || !_fullRecord) + ? 0. + : (1. - _showLockAnimation.value(0.)); + const auto ttlFrom = anyTop + - _ttlButton->height() + - (_ttlButton->height() * (1. - lockHiddenProgress)); if (type == TTLAnimationType::RightLeft) { const auto finalRight = _outerContainer->width() - rect::right(me) @@ -1551,6 +1556,9 @@ void VoiceRecordBar::init() { } else if (value == 1. && show) { computeAndSetLockProgress(QCursor::pos()); } + if (_fullRecord && !show) { + updateTTLGeometry(TTLAnimationType::RightLeft, 1.); + } }; _showLockAnimation.start(std::move(callback), from, to, duration); }, lifetime()); @@ -1664,6 +1672,7 @@ void VoiceRecordBar::init() { } _recordingTipRequire = crl::now(); _recordingVideo = (_send->type() == Ui::SendButton::Type::Round); + _fullRecord = false; _ttlButton = nullptr; _lock->setRecordingVideo(_recordingVideo); _startTimer.callOnce(st::universalDuration); @@ -1828,6 +1837,7 @@ void VoiceRecordBar::startRecording() { ) | rpl::start_with_next_error([=](const Update &update) { recordUpdated(update.level, update.samples); if (update.finished) { + _fullRecord = true; stopRecording(StopType::Listen); _lockShowing = false; } diff --git a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.h b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.h index 9c9d66c55..027366a59 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.h +++ b/Telegram/SourceFiles/history/view/controls/history_view_voice_record_bar.h @@ -208,6 +208,7 @@ private: std::vector> _videoHiding; rpl::lifetime _videoCapturerLifetime; bool _recordingVideo = false; + bool _fullRecord = false; const style::font &_cancelFont;