Fix recording single-listen tooltip text.

This commit is contained in:
John Preston 2024-10-30 10:02:09 +04:00
parent 66be2ac6ca
commit 2d6d89b1cf
2 changed files with 12 additions and 5 deletions

View file

@ -3276,6 +3276,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_record_video_problem" = "Could not start video recording. Please check your camera.";
"lng_record_once_first_tooltip" = "Click to set this message to **Play Once**.";
"lng_record_once_active_tooltip" = "The recipient will be able to listen only once.";
"lng_record_once_active_video" = "The recipient will be able to watch only once.";
"lng_will_be_notified" = "Subscribers will be notified when you post.";
"lng_wont_be_notified" = "Subscribers will receive a silent notification.";
"lng_willbe_history" = "Select a chat to start messaging";

View file

@ -364,7 +364,8 @@ class TTLButton final : public Ui::RippleButton {
public:
TTLButton(
not_null<Ui::RpWidget*> parent,
const style::RecordBar &st);
const style::RecordBar &st,
bool recordingVideo);
void clearState() override;
@ -383,7 +384,8 @@ private:
TTLButton::TTLButton(
not_null<Ui::RpWidget*> parent,
const style::RecordBar &st)
const style::RecordBar &st,
bool recordingVideo)
: RippleButton(parent, st.lock.ripple)
, _st(st)
, _rippleRect(Rect(Size(st::historyRecordLockTopShadow.width()))
@ -410,8 +412,10 @@ TTLButton::TTLButton(
}
auto text = rpl::conditional(
Core::App().settings().ttlVoiceClickTooltipHiddenValue(),
tr::lng_record_once_active_tooltip(
Ui::Text::RichLangValue),
(recordingVideo
? tr::lng_record_once_active_video
: tr::lng_record_once_active_tooltip)(
Ui::Text::RichLangValue),
tr::lng_record_once_first_tooltip(
Ui::Text::RichLangValue));
_tooltip.reset(Ui::CreateChild<Ui::ImportantTooltip>(
@ -1624,7 +1628,8 @@ void VoiceRecordBar::init() {
if (!_ttlButton) {
_ttlButton = std::make_unique<TTLButton>(
_outerContainer,
_st);
_st,
_recordingVideo);
}
_ttlButton->show();
}
@ -1659,6 +1664,7 @@ void VoiceRecordBar::init() {
}
_recordingTipRequire = crl::now();
_recordingVideo = (_send->type() == Ui::SendButton::Type::Round);
_ttlButton = nullptr;
_lock->setRecordingVideo(_recordingVideo);
_startTimer.callOnce(st::universalDuration);
} else if (e->type() == QEvent::MouseButtonRelease) {