2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-09-02 07:25:46 +00:00

Support markdown and replaces in media captions.

This commit is contained in:
John Preston
2018-05-24 16:03:21 +03:00
parent 6f6ec217e3
commit 5e7642b42a
22 changed files with 133 additions and 63 deletions

View File

@@ -329,6 +329,9 @@ void GroupInfoBox::prepare() {
langFactory(lng_create_group_description));
_description->show();
_description->setMaxLength(kMaxChannelDescription);
_description->setInstantReplaces(Ui::InstantReplaces::Default());
_description->setInstantReplacesEnabled(
Global::ReplaceEmojiValue());
connect(_description, SIGNAL(resized()), this, SLOT(onDescriptionResized()));
connect(_description, SIGNAL(submitted(bool)), this, SLOT(onNext()));
@@ -1080,6 +1083,7 @@ void EditBioBox::prepare() {
connect(_bio, &Ui::InputField::resized, this, [this] { updateMaxHeight(); });
connect(_bio, &Ui::InputField::changed, this, [this] { handleBioUpdated(); });
_bio->setInstantReplaces(Ui::InstantReplaces::Default());
_bio->setInstantReplacesEnabled(Global::ReplaceEmojiValue());
handleBioUpdated();
updateMaxHeight();
}
@@ -1161,6 +1165,8 @@ void EditChannelBox::prepare() {
_title->setMaxLength(kMaxGroupChannelTitle);
_description->setMaxLength(kMaxChannelDescription);
_description->setInstantReplaces(Ui::InstantReplaces::Default());
_description->setInstantReplacesEnabled(Global::ReplaceEmojiValue());
connect(_description, SIGNAL(resized()), this, SLOT(onDescriptionResized()));
connect(_description, SIGNAL(submitted(bool)), this, SLOT(onSave()));