From 93605db690dc3dc42307b569a35c083ef380e30d Mon Sep 17 00:00:00 2001 From: John Preston Date: Mon, 28 Oct 2024 09:22:57 +0400 Subject: [PATCH] Use custom toast for video-not-available state. --- Telegram/Resources/langs/lang.strings | 1 + Telegram/SourceFiles/history/history_widget.cpp | 4 +++- .../history/view/controls/history_view_compose_controls.cpp | 4 +++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index f72f4cbd3..b3b8e83a7 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -3267,6 +3267,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_record_listen_cancel_sure" = "Do you want to discard your recorded voice message?"; "lng_record_listen_cancel_sure_round" = "Do you want to discard your recorded video message?"; "lng_record_lock_discard" = "Discard"; +"lng_record_hold_tip" = "Please hold the mouse button pressed to record a voice message."; "lng_record_voice_tip" = "Hold to record audio. Click to switch to video."; "lng_record_video_tip" = "Hold to record video. Click to switch to audio."; "lng_record_audio_problem" = "Could not start audio recording. Please check your microphone."; diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 2a9ced8b2..440860a75 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -1092,7 +1092,9 @@ void HistoryWidget::initVoiceRecordBar() { updateSendButtonType(); switch (_send->type()) { case Ui::SendButton::Type::Record: - controller()->showToast(tr::lng_record_voice_tip(tr::now)); + controller()->showToast(_canRecordVideoMessage + ? tr::lng_record_voice_tip(tr::now) + : tr::lng_record_hold_tip(tr::now)); break; case Ui::SendButton::Type::Round: controller()->showToast(tr::lng_record_video_tip(tr::now)); diff --git a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp index acef28096..6ed3a0a9c 100644 --- a/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp +++ b/Telegram/SourceFiles/history/view/controls/history_view_compose_controls.cpp @@ -2431,7 +2431,9 @@ void ComposeControls::initVoiceRecordBar() { updateSendButtonType(); switch (_send->type()) { case Ui::SendButton::Type::Record: - _show->showToast(tr::lng_record_voice_tip(tr::now)); + _show->showToast(_canRecordVideoMessage + ? tr::lng_record_voice_tip(tr::now) + : tr::lng_record_hold_tip(tr::now)); break; case Ui::SendButton::Type::Round: _show->showToast(tr::lng_record_video_tip(tr::now));