mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Use correct reply placeholder in stories view.
This commit is contained in:
parent
2664d984d9
commit
ebd8380019
4 changed files with 11 additions and 2 deletions
|
@ -2044,6 +2044,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||||
"lng_broadcast_ph" = "Broadcast a message...";
|
"lng_broadcast_ph" = "Broadcast a message...";
|
||||||
"lng_broadcast_silent_ph" = "Silent broadcast...";
|
"lng_broadcast_silent_ph" = "Silent broadcast...";
|
||||||
"lng_send_anonymous_ph" = "Send anonymously...";
|
"lng_send_anonymous_ph" = "Send anonymously...";
|
||||||
|
"lng_story_reply_ph" = "Reply privately...";
|
||||||
"lng_send_text_no" = "Text not allowed.";
|
"lng_send_text_no" = "Text not allowed.";
|
||||||
"lng_send_text_no_about" = "The admins of this group only allow sending {types}.";
|
"lng_send_text_no_about" = "The admins of this group only allow sending {types}.";
|
||||||
"lng_send_text_type_and_last" = "{types} and {last}";
|
"lng_send_text_type_and_last" = "{types} and {last}";
|
||||||
|
|
|
@ -971,12 +971,15 @@ ComposeControls::ComposeControls(
|
||||||
, _tabbedSelectorToggle(Ui::CreateChild<Ui::EmojiButton>(
|
, _tabbedSelectorToggle(Ui::CreateChild<Ui::EmojiButton>(
|
||||||
_wrap.get(),
|
_wrap.get(),
|
||||||
_st.emoji))
|
_st.emoji))
|
||||||
|
, _fieldCustomPlaceholder(std::move(descriptor.customPlaceholder))
|
||||||
, _field(
|
, _field(
|
||||||
Ui::CreateChild<Ui::InputField>(
|
Ui::CreateChild<Ui::InputField>(
|
||||||
_wrap.get(),
|
_wrap.get(),
|
||||||
_st.field,
|
_st.field,
|
||||||
Ui::InputField::Mode::MultiLine,
|
Ui::InputField::Mode::MultiLine,
|
||||||
tr::lng_message_ph()))
|
(_fieldCustomPlaceholder
|
||||||
|
? rpl::duplicate(_fieldCustomPlaceholder)
|
||||||
|
: tr::lng_message_ph())))
|
||||||
, _botCommandStart(_features.botCommandSend
|
, _botCommandStart(_features.botCommandSend
|
||||||
? Ui::CreateChild<Ui::IconButton>(
|
? Ui::CreateChild<Ui::IconButton>(
|
||||||
_wrap.get(),
|
_wrap.get(),
|
||||||
|
@ -1816,7 +1819,9 @@ void ComposeControls::updateFieldPlaceholder() {
|
||||||
}
|
}
|
||||||
|
|
||||||
_field->setPlaceholder([&] {
|
_field->setPlaceholder([&] {
|
||||||
if (isEditingMessage()) {
|
if (_fieldCustomPlaceholder) {
|
||||||
|
return rpl::duplicate(_fieldCustomPlaceholder);
|
||||||
|
} else if (isEditingMessage()) {
|
||||||
return tr::lng_edit_message_text();
|
return tr::lng_edit_message_text();
|
||||||
} else if (!_history) {
|
} else if (!_history) {
|
||||||
return tr::lng_message_ph();
|
return tr::lng_message_ph();
|
||||||
|
|
|
@ -102,6 +102,7 @@ struct ComposeControlsDescriptor {
|
||||||
SendMenu::Type sendMenuType = {};
|
SendMenu::Type sendMenuType = {};
|
||||||
Window::SessionController *regularWindow = nullptr;
|
Window::SessionController *regularWindow = nullptr;
|
||||||
rpl::producer<ChatHelpers::FileChosen> stickerOrEmojiChosen;
|
rpl::producer<ChatHelpers::FileChosen> stickerOrEmojiChosen;
|
||||||
|
rpl::producer<QString> customPlaceholder;
|
||||||
bool voiceLockFromBottom = false;
|
bool voiceLockFromBottom = false;
|
||||||
ChatHelpers::ComposeFeatures features;
|
ChatHelpers::ComposeFeatures features;
|
||||||
};
|
};
|
||||||
|
@ -353,6 +354,7 @@ private:
|
||||||
const not_null<Ui::IconButton*> _attachToggle;
|
const not_null<Ui::IconButton*> _attachToggle;
|
||||||
std::unique_ptr<Ui::IconButton> _replaceMedia;
|
std::unique_ptr<Ui::IconButton> _replaceMedia;
|
||||||
const not_null<Ui::EmojiButton*> _tabbedSelectorToggle;
|
const not_null<Ui::EmojiButton*> _tabbedSelectorToggle;
|
||||||
|
rpl::producer<QString> _fieldCustomPlaceholder;
|
||||||
const not_null<Ui::InputField*> _field;
|
const not_null<Ui::InputField*> _field;
|
||||||
Ui::IconButton * const _botCommandStart = nullptr;
|
Ui::IconButton * const _botCommandStart = nullptr;
|
||||||
std::unique_ptr<Ui::SendAsButton> _sendAs;
|
std::unique_ptr<Ui::SendAsButton> _sendAs;
|
||||||
|
|
|
@ -85,6 +85,7 @@ ReplyArea::ReplyArea(not_null<Controller*> controller)
|
||||||
.mode = HistoryView::ComposeControlsMode::Normal,
|
.mode = HistoryView::ComposeControlsMode::Normal,
|
||||||
.sendMenuType = SendMenu::Type::SilentOnly,
|
.sendMenuType = SendMenu::Type::SilentOnly,
|
||||||
.stickerOrEmojiChosen = _controller->stickerOrEmojiChosen(),
|
.stickerOrEmojiChosen = _controller->stickerOrEmojiChosen(),
|
||||||
|
.customPlaceholder = tr::lng_story_reply_ph(),
|
||||||
.voiceLockFromBottom = true,
|
.voiceLockFromBottom = true,
|
||||||
.features = {
|
.features = {
|
||||||
.sendAs = false,
|
.sendAs = false,
|
||||||
|
|
Loading…
Add table
Reference in a new issue