2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-31 06:35:14 +00:00

Support animated emoji in caption edit fields.

This commit is contained in:
John Preston
2022-07-01 17:01:39 +04:00
parent 00d1828fbe
commit 806c5ddf29
8 changed files with 60 additions and 64 deletions

View File

@@ -672,9 +672,19 @@ void SendFilesBox::updateSendWayControlsVisibility() {
}
void SendFilesBox::setupCaption() {
_caption->setMaxLength(kMaxMessageLength);
InitMessageFieldHandlers(
_controller,
_caption.data(),
Window::GifPauseReason::Layer);
Ui::Emoji::SuggestionsController::Init(
getDelegate()->outerContainer(),
_caption,
&_controller->session());
_caption->setSubmitSettings(
Core::App().settings().sendSubmitWay());
_caption->setMaxLength(kMaxMessageLength);
connect(_caption, &Ui::InputField::resized, [=] {
captionResized();
});
@@ -696,21 +706,6 @@ void SendFilesBox::setupCaption() {
}
Unexpected("action in MimeData hook.");
});
const auto show = std::make_shared<Window::Show>(_controller);
const auto session = &_controller->session();
_caption->setInstantReplaces(Ui::InstantReplaces::Default());
_caption->setInstantReplacesEnabled(
Core::App().settings().replaceEmojiValue());
_caption->setMarkdownReplacesEnabled(rpl::single(true));
_caption->setEditLinkCallback(
DefaultEditLinkCallback(show, session, _caption));
Ui::Emoji::SuggestionsController::Init(
getDelegate()->outerContainer(),
_caption,
session);
InitSpellchecker(show, session, _caption);
updateCaptionPlaceholder();
setupEmojiPanel();