Fix chat preview and new emoji interactions.

This commit is contained in:
John Preston 2024-05-14 18:35:57 +04:00
parent cde70b9807
commit 363b700f1f
3 changed files with 12 additions and 1 deletions

View File

@ -129,6 +129,7 @@ private:
void listAddTranslatedItems(
not_null<TranslateTracker*> tracker) override;
not_null<Window::SessionController*> listWindow() override;
not_null<QWidget*> listEmojiInteractionsParent() override;
not_null<const Ui::ChatStyle*> listChatStyle() override;
rpl::producer<bool> listChatWideValue() override;
std::unique_ptr<Reactions::Manager> listMakeReactionsManager(
@ -676,6 +677,10 @@ not_null<Window::SessionController*> Item::listWindow() {
Unexpected("Item::listWindow.");
}
not_null<QWidget*> Item::listEmojiInteractionsParent() {
return this;
}
not_null<const Ui::ChatStyle*> Item::listChatStyle() {
return _chatStyle.get();
}

View File

@ -101,6 +101,10 @@ not_null<Window::SessionController*> WindowListDelegate::listWindow() {
return _window;
}
not_null<QWidget*> WindowListDelegate::listEmojiInteractionsParent() {
return _window->content();
}
not_null<const Ui::ChatStyle*> WindowListDelegate::listChatStyle() {
return _window->chatStyle();
}
@ -376,7 +380,7 @@ ListWidget::ListWidget(
, _session(session)
, _emojiInteractions(std::make_unique<EmojiInteractions>(
this,
_delegate->listWindow()->content(),
_delegate->listEmojiInteractionsParent(),
session,
[=](not_null<const Element*> view) { return itemTop(view); }))
, _context(_delegate->listContext())

View File

@ -161,6 +161,7 @@ public:
// Methods that use Window::SessionController by default.
virtual not_null<Window::SessionController*> listWindow() = 0;
virtual not_null<QWidget*> listEmojiInteractionsParent() = 0;
virtual not_null<const Ui::ChatStyle*> listChatStyle() = 0;
virtual rpl::producer<bool> listChatWideValue() = 0;
virtual std::unique_ptr<Reactions::Manager> listMakeReactionsManager(
@ -194,6 +195,7 @@ public:
explicit WindowListDelegate(not_null<Window::SessionController*> window);
not_null<Window::SessionController*> listWindow() override;
not_null<QWidget*> listEmojiInteractionsParent() override;
not_null<const Ui::ChatStyle*> listChatStyle() override;
rpl::producer<bool> listChatWideValue() override;
std::unique_ptr<Reactions::Manager> listMakeReactionsManager(