mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Position ttl button correctly on record finish.
This commit is contained in:
parent
2d6d89b1cf
commit
472a2fe802
2 changed files with 12 additions and 1 deletions
|
@ -1431,7 +1431,12 @@ void VoiceRecordBar::updateTTLGeometry(
|
||||||
const auto parent = parentWidget();
|
const auto parent = parentWidget();
|
||||||
const auto me = Ui::MapFrom(_outerContainer, parent, geometry());
|
const auto me = Ui::MapFrom(_outerContainer, parent, geometry());
|
||||||
const auto anyTop = me.y() - st::historyRecordLockPosition.y();
|
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) {
|
if (type == TTLAnimationType::RightLeft) {
|
||||||
const auto finalRight = _outerContainer->width()
|
const auto finalRight = _outerContainer->width()
|
||||||
- rect::right(me)
|
- rect::right(me)
|
||||||
|
@ -1551,6 +1556,9 @@ void VoiceRecordBar::init() {
|
||||||
} else if (value == 1. && show) {
|
} else if (value == 1. && show) {
|
||||||
computeAndSetLockProgress(QCursor::pos());
|
computeAndSetLockProgress(QCursor::pos());
|
||||||
}
|
}
|
||||||
|
if (_fullRecord && !show) {
|
||||||
|
updateTTLGeometry(TTLAnimationType::RightLeft, 1.);
|
||||||
|
}
|
||||||
};
|
};
|
||||||
_showLockAnimation.start(std::move(callback), from, to, duration);
|
_showLockAnimation.start(std::move(callback), from, to, duration);
|
||||||
}, lifetime());
|
}, lifetime());
|
||||||
|
@ -1664,6 +1672,7 @@ void VoiceRecordBar::init() {
|
||||||
}
|
}
|
||||||
_recordingTipRequire = crl::now();
|
_recordingTipRequire = crl::now();
|
||||||
_recordingVideo = (_send->type() == Ui::SendButton::Type::Round);
|
_recordingVideo = (_send->type() == Ui::SendButton::Type::Round);
|
||||||
|
_fullRecord = false;
|
||||||
_ttlButton = nullptr;
|
_ttlButton = nullptr;
|
||||||
_lock->setRecordingVideo(_recordingVideo);
|
_lock->setRecordingVideo(_recordingVideo);
|
||||||
_startTimer.callOnce(st::universalDuration);
|
_startTimer.callOnce(st::universalDuration);
|
||||||
|
@ -1828,6 +1837,7 @@ void VoiceRecordBar::startRecording() {
|
||||||
) | rpl::start_with_next_error([=](const Update &update) {
|
) | rpl::start_with_next_error([=](const Update &update) {
|
||||||
recordUpdated(update.level, update.samples);
|
recordUpdated(update.level, update.samples);
|
||||||
if (update.finished) {
|
if (update.finished) {
|
||||||
|
_fullRecord = true;
|
||||||
stopRecording(StopType::Listen);
|
stopRecording(StopType::Listen);
|
||||||
_lockShowing = false;
|
_lockShowing = false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -208,6 +208,7 @@ private:
|
||||||
std::vector<std::unique_ptr<Ui::RoundVideoRecorder>> _videoHiding;
|
std::vector<std::unique_ptr<Ui::RoundVideoRecorder>> _videoHiding;
|
||||||
rpl::lifetime _videoCapturerLifetime;
|
rpl::lifetime _videoCapturerLifetime;
|
||||||
bool _recordingVideo = false;
|
bool _recordingVideo = false;
|
||||||
|
bool _fullRecord = false;
|
||||||
|
|
||||||
const style::font &_cancelFont;
|
const style::font &_cancelFont;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue