From b4a7d98fa0767704746506b7f33015a53976bf6f Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Thu, 8 Dec 2022 17:59:53 +0300 Subject: [PATCH] Added support of custom emoji to translate box. --- Telegram/Resources/langs/lang.strings | 2 +- Telegram/SourceFiles/boxes/translate_box.cpp | 8 +++++++- Telegram/lib_spellcheck | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Telegram/Resources/langs/lang.strings b/Telegram/Resources/langs/lang.strings index 7b6c43c33..da44f5438 100644 --- a/Telegram/Resources/langs/lang.strings +++ b/Telegram/Resources/langs/lang.strings @@ -317,7 +317,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL "lng_intro_qr_title" = "Scan From Mobile Telegram"; "lng_intro_qr_step1" = "Open Telegram on your phone"; -"lng_intro_qr_step2" = "Go to Settings > Devices > Scan QR Code"; +"lng_intro_qr_step2" = "Go to Settings > Devices > Link Desktop"; "lng_intro_qr_step3" = "Scan this image to Log In"; "lng_intro_qr_skip" = "Or log in using your phone number"; diff --git a/Telegram/SourceFiles/boxes/translate_box.cpp b/Telegram/SourceFiles/boxes/translate_box.cpp index 60eb46825..4ef60894b 100644 --- a/Telegram/SourceFiles/boxes/translate_box.cpp +++ b/Telegram/SourceFiles/boxes/translate_box.cpp @@ -9,6 +9,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "core/application.h" #include "core/core_settings.h" +#include "core/ui_integration.h" #include "data/data_peer.h" #include "lang/lang_instance.h" #include "lang/lang_keys.h" @@ -196,7 +197,12 @@ void TranslateBox( original->entity()->setContextMenuHook([](auto&&) { }); } - original->entity()->setMarkedText(text); + original->entity()->setMarkedText( + text, + Core::MarkedTextContext{ + .session = &peer->session(), + .customEmojiRepaint = [=] { original->entity()->update(); }, + }); original->setMinimalHeight(lineHeight); original->hide(anim::type::instant); diff --git a/Telegram/lib_spellcheck b/Telegram/lib_spellcheck index 95d14bb5a..68e0b6fa2 160000 --- a/Telegram/lib_spellcheck +++ b/Telegram/lib_spellcheck @@ -1 +1 @@ -Subproject commit 95d14bb5abec1df1463fe1083820119160edc579 +Subproject commit 68e0b6fa217c9f2ea82a79f073113c8c5ff6e6c5