Use separate record cancel text in stories.

This commit is contained in:
John Preston 2023-07-20 10:33:45 +04:00
parent 0b7af5bfe3
commit 5b10b7e15f
6 changed files with 8 additions and 1 deletions

View File

@ -2062,6 +2062,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_send_as_premium_required" = "Subscribe to {link} to be able to comment on behalf of your channels in group chats.";
"lng_send_as_premium_required_link" = "Telegram Premium";
"lng_record_cancel" = "Release outside this field to cancel";
"lng_record_cancel_stories" = "Release outside to cancel";
"lng_record_lock_cancel_sure" = "Are you sure you want to stop recording and discard your voice message?";
"lng_record_listen_cancel_sure" = "Are you sure you want to discard your recorded voice message?";
"lng_record_lock_discard" = "Discard";

View File

@ -996,6 +996,7 @@ ComposeControls::ComposeControls(
.outerContainer = parent,
.show = _show,
.send = _send,
.customCancelText = descriptor.voiceCustomCancelText,
.stOverride = &_st.record,
.recorderHeight = st::historySendSize.height(),
.lockFromBottom = descriptor.voiceLockFromBottom,

View File

@ -103,6 +103,7 @@ struct ComposeControlsDescriptor {
Window::SessionController *regularWindow = nullptr;
rpl::producer<ChatHelpers::FileChosen> stickerOrEmojiChosen;
rpl::producer<QString> customPlaceholder;
QString voiceCustomCancelText;
bool voiceLockFromBottom = false;
ChatHelpers::ComposeFeatures features;
};

View File

@ -1024,7 +1024,9 @@ VoiceRecordBar::VoiceRecordBar(
, _startTimer([=] { startRecording(); })
, _message(
st::historyRecordTextStyle,
tr::lng_record_cancel(tr::now),
(!descriptor.customCancelText.isEmpty()
? descriptor.customCancelText
: tr::lng_record_cancel(tr::now)),
TextParseOptions{ TextParseMultiline, 0, 0, Qt::LayoutDirectionAuto })
, _lockFromBottom(descriptor.lockFromBottom)
, _cancelFont(st::historyRecordFont) {

View File

@ -43,6 +43,7 @@ struct VoiceRecordBarDescriptor {
not_null<Ui::RpWidget*> outerContainer;
std::shared_ptr<ChatHelpers::Show> show;
std::shared_ptr<Ui::SendButton> send;
QString customCancelText;
const style::RecordBar *stOverride = nullptr;
int recorderHeight = 0;
bool lockFromBottom = false;

View File

@ -86,6 +86,7 @@ ReplyArea::ReplyArea(not_null<Controller*> controller)
.sendMenuType = SendMenu::Type::SilentOnly,
.stickerOrEmojiChosen = _controller->stickerOrEmojiChosen(),
.customPlaceholder = tr::lng_story_reply_ph(),
.voiceCustomCancelText = tr::lng_record_cancel_stories(tr::now),
.voiceLockFromBottom = true,
.features = {
.sendAs = false,