mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 21:57:10 +02:00
Fix custom emoji in initial send files caption.
This commit is contained in:
parent
888306c017
commit
7c2d3a8855
2 changed files with 12 additions and 6 deletions
|
@ -260,12 +260,8 @@ SendFilesBox::SendFilesBox(
|
|||
, _sendLimit(peer->slowmodeApplied() ? SendLimit::One : SendLimit::Many)
|
||||
, _sendMenuType(sendMenuType)
|
||||
, _allowEmojiWithoutPremium(Data::AllowEmojiWithoutPremium(peer))
|
||||
, _caption(
|
||||
this,
|
||||
st::confirmCaptionArea,
|
||||
Ui::InputField::Mode::MultiLine,
|
||||
nullptr,
|
||||
caption)
|
||||
, _caption(this, st::confirmCaptionArea, Ui::InputField::Mode::MultiLine)
|
||||
, _prefilledCaptionText(std::move(caption))
|
||||
, _scroll(this, st::boxScroll)
|
||||
, _inner(
|
||||
_scroll->setOwnedWidget(
|
||||
|
@ -688,6 +684,15 @@ void SendFilesBox::setupCaption() {
|
|||
&_controller->session(),
|
||||
{ .suggestCustomEmoji = true, .allowCustomWithoutPremium = allow });
|
||||
|
||||
if (!_prefilledCaptionText.text.isEmpty()) {
|
||||
_caption->setTextWithTags(
|
||||
_prefilledCaptionText,
|
||||
Ui::InputField::HistoryAction::Clear);
|
||||
|
||||
auto cursor = _caption->textCursor();
|
||||
cursor.movePosition(QTextCursor::End);
|
||||
_caption->setTextCursor(cursor);
|
||||
}
|
||||
_caption->setSubmitSettings(
|
||||
Core::App().settings().sendSubmitWay());
|
||||
_caption->setMaxLength(kMaxMessageLength);
|
||||
|
|
|
@ -180,6 +180,7 @@ private:
|
|||
bool _confirmed = false;
|
||||
|
||||
object_ptr<Ui::InputField> _caption = { nullptr };
|
||||
TextWithTags _prefilledCaptionText;
|
||||
object_ptr<Ui::EmojiButton> _emojiToggle = { nullptr };
|
||||
base::unique_qptr<ChatHelpers::TabbedPanel> _emojiPanel;
|
||||
base::unique_qptr<QObject> _emojiFilter;
|
||||
|
|
Loading…
Add table
Reference in a new issue