Use correct reply placeholder in stories view.

This commit is contained in:
John Preston 2023-07-12 23:17:08 +04:00
parent 2664d984d9
commit ebd8380019
4 changed files with 11 additions and 2 deletions

View File

@ -2044,6 +2044,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
"lng_broadcast_ph" = "Broadcast a message...";
"lng_broadcast_silent_ph" = "Silent broadcast...";
"lng_send_anonymous_ph" = "Send anonymously...";
"lng_story_reply_ph" = "Reply privately...";
"lng_send_text_no" = "Text not allowed.";
"lng_send_text_no_about" = "The admins of this group only allow sending {types}.";
"lng_send_text_type_and_last" = "{types} and {last}";

View File

@ -971,12 +971,15 @@ ComposeControls::ComposeControls(
, _tabbedSelectorToggle(Ui::CreateChild<Ui::EmojiButton>(
_wrap.get(),
_st.emoji))
, _fieldCustomPlaceholder(std::move(descriptor.customPlaceholder))
, _field(
Ui::CreateChild<Ui::InputField>(
_wrap.get(),
_st.field,
Ui::InputField::Mode::MultiLine,
tr::lng_message_ph()))
(_fieldCustomPlaceholder
? rpl::duplicate(_fieldCustomPlaceholder)
: tr::lng_message_ph())))
, _botCommandStart(_features.botCommandSend
? Ui::CreateChild<Ui::IconButton>(
_wrap.get(),
@ -1816,7 +1819,9 @@ void ComposeControls::updateFieldPlaceholder() {
}
_field->setPlaceholder([&] {
if (isEditingMessage()) {
if (_fieldCustomPlaceholder) {
return rpl::duplicate(_fieldCustomPlaceholder);
} else if (isEditingMessage()) {
return tr::lng_edit_message_text();
} else if (!_history) {
return tr::lng_message_ph();

View File

@ -102,6 +102,7 @@ struct ComposeControlsDescriptor {
SendMenu::Type sendMenuType = {};
Window::SessionController *regularWindow = nullptr;
rpl::producer<ChatHelpers::FileChosen> stickerOrEmojiChosen;
rpl::producer<QString> customPlaceholder;
bool voiceLockFromBottom = false;
ChatHelpers::ComposeFeatures features;
};
@ -353,6 +354,7 @@ private:
const not_null<Ui::IconButton*> _attachToggle;
std::unique_ptr<Ui::IconButton> _replaceMedia;
const not_null<Ui::EmojiButton*> _tabbedSelectorToggle;
rpl::producer<QString> _fieldCustomPlaceholder;
const not_null<Ui::InputField*> _field;
Ui::IconButton * const _botCommandStart = nullptr;
std::unique_ptr<Ui::SendAsButton> _sendAs;

View File

@ -85,6 +85,7 @@ ReplyArea::ReplyArea(not_null<Controller*> controller)
.mode = HistoryView::ComposeControlsMode::Normal,
.sendMenuType = SendMenu::Type::SilentOnly,
.stickerOrEmojiChosen = _controller->stickerOrEmojiChosen(),
.customPlaceholder = tr::lng_story_reply_ph(),
.voiceLockFromBottom = true,
.features = {
.sendAs = false,