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 bdd887c413..ff7531982e 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 @@ -623,16 +623,15 @@ RecordLock::RecordLock(not_null parent) Qt::SolidLine, Qt::SquareCap, Qt::RoundJoin) { - resize( - st::historyRecordLockTopShadow.width(), - st::historyRecordLockSize.height()); - // resize(st::historyRecordLockSize); init(); } void RecordLock::init() { shownValue( ) | rpl::start_with_next([=](bool shown) { + resize( + st::historyRecordLockTopShadow.width(), + st::historyRecordLockSize.height()); if (!shown) { setCursor(style::cur_default); setAttribute(Qt::WA_TransparentForMouseEvents, true); @@ -667,6 +666,10 @@ void RecordLock::init() { if (value == to) { setCursor(style::cur_pointer); setAttribute(Qt::WA_TransparentForMouseEvents, false); + + resize( + st::historyRecordLockTopShadow.width(), + st::historyRecordLockTopShadow.width()); } }; _lockAnimation.start(std::move(callback), from, to, duration); @@ -1115,9 +1118,10 @@ void VoiceRecordBar::setStartRecordingFilter(Fn &&callback) { } void VoiceRecordBar::setLockBottom(rpl::producer &&bottom) { - std::move( - bottom - ) | rpl::start_with_next([=](int value) { + rpl::combine( + std::move(bottom), + _lock->sizeValue() | rpl::map_to(true) // Dummy value. + ) | rpl::start_with_next([=](int value, bool dummy) { _lock->moveToLeft(_lock->x(), value - _lock->height()); }, lifetime()); }