diff --git a/Telegram/SourceFiles/history/history_view_top_toast.cpp b/Telegram/SourceFiles/history/history_view_top_toast.cpp index f3ae8b012..2315e20c6 100644 --- a/Telegram/SourceFiles/history/history_view_top_toast.cpp +++ b/Telegram/SourceFiles/history/history_view_top_toast.cpp @@ -8,6 +8,7 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "history/history_view_top_toast.h" #include "ui/toast/toast.h" +#include "core/ui_integration.h" #include "styles/style_chat.h" namespace HistoryView { @@ -27,8 +28,15 @@ InfoTooltip::InfoTooltip() = default; void InfoTooltip::show( not_null parent, + not_null session, const TextWithEntities &text, Fn hiddenCallback) { + const auto context = [=](not_null toast) { + return Core::MarkedTextContext{ + .session = session, + .customEmojiRepaint = [=] { toast->update(); }, + }; + }; hide(anim::type::normal); _topToast = Ui::Toast::Show(parent, Ui::Toast::Config{ .text = text, @@ -37,6 +45,7 @@ void InfoTooltip::show( .multiline = true, .dark = true, .slideSide = RectPart::Top, + .textContext = context, }); if (const auto strong = _topToast.get()) { if (hiddenCallback) { diff --git a/Telegram/SourceFiles/history/history_view_top_toast.h b/Telegram/SourceFiles/history/history_view_top_toast.h index 1eb02fbaa..5c923f34c 100644 --- a/Telegram/SourceFiles/history/history_view_top_toast.h +++ b/Telegram/SourceFiles/history/history_view_top_toast.h @@ -9,6 +9,10 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL #include "base/weak_ptr.h" +namespace Main { +class Session; +} // namespace Main + namespace Ui::Toast { class Instance; } // namespace Ui::Toast @@ -21,6 +25,7 @@ public: void show( not_null parent, + not_null session, const TextWithEntities &text, Fn hiddenCallback); void hide(anim::type animated); diff --git a/Telegram/SourceFiles/history/history_widget.cpp b/Telegram/SourceFiles/history/history_widget.cpp index 4b5ce2e62..85f3f4d11 100644 --- a/Telegram/SourceFiles/history/history_widget.cpp +++ b/Telegram/SourceFiles/history/history_widget.cpp @@ -6765,7 +6765,11 @@ bool HistoryWidget::sendExistingPhoto( void HistoryWidget::showInfoTooltip( const TextWithEntities &text, Fn hiddenCallback) { - _topToast.show(_scroll.data(), text, std::move(hiddenCallback)); + _topToast.show( + _scroll.data(), + &session(), + text, + std::move(hiddenCallback)); } void HistoryWidget::showPremiumStickerTooltip( diff --git a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp index f6fb21bed..2035b0f68 100644 --- a/Telegram/SourceFiles/history/view/history_view_list_widget.cpp +++ b/Telegram/SourceFiles/history/view/history_view_list_widget.cpp @@ -1456,7 +1456,7 @@ void ListWidget::elementShowTooltip( const TextWithEntities &text, Fn hiddenCallback) { // Under the parent is supposed to be a scroll widget. - _topToast.show(parentWidget(), text, hiddenCallback); + _topToast.show(parentWidget(), &session(), text, hiddenCallback); } bool ListWidget::elementAnimationsPaused() { diff --git a/Telegram/lib_ui b/Telegram/lib_ui index 89ae115a8..eafd7dc81 160000 --- a/Telegram/lib_ui +++ b/Telegram/lib_ui @@ -1 +1 @@ -Subproject commit 89ae115a878feb9e07fe7423fcf123397eba5966 +Subproject commit eafd7dc818433ec435c2862bb91b7e3c7f65336b