SL-20416 Choose emoji floater puts emoji in the chat window that opened it

master
Alexander Gavriliuk 2023-11-10 02:58:01 +01:00 committed by Guru
parent 88b15ff62c
commit 1ef524986f
2 changed files with 26 additions and 12 deletions

View File

@ -273,7 +273,7 @@ BOOL LLFloaterIMSessionTab::postBuild()
mEmojiRecentIconsCtrl->setVisible(false);
mEmojiPickerToggleBtn = getChild<LLButton>("emoji_picker_toggle_btn");
mEmojiPickerToggleBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiPickerToggleBtnClicked(this); });
mEmojiPickerToggleBtn->setClickedCallback([this](LLUICtrl*, const LLSD&) { onEmojiPickerToggleBtnClicked(); });
mGearBtn = getChild<LLButton>("gear_btn");
mAddBtn = getChild<LLButton>("add_btn");
@ -470,18 +470,18 @@ void LLFloaterIMSessionTab::onEmojiRecentPanelToggleBtnClicked(LLFloaterIMSessio
}
}
void LLFloaterIMSessionTab::onEmojiPickerToggleBtnClicked(LLFloaterIMSessionTab* self)
void LLFloaterIMSessionTab::onEmojiPickerToggleBtnClicked()
{
if (LLFloaterEmojiPicker* picker = LLFloaterEmojiPicker::getInstance())
{
if (!picker->isShown())
{
picker->show(
[self](llwchar emoji) { self->onEmojiPicked(emoji); },
[self]() { self->onEmojiPickerClosed(); });
if (LLFloater* root_floater = gFloaterView->getParentFloater(self))
[](llwchar emoji) { onEmojiPicked(emoji); },
[]() { onEmojiPickerClosed(); });
if (LLFloaterIMContainer* im_box = LLFloaterIMContainer::findInstance())
{
root_floater->addDependentFloater(picker, TRUE, TRUE);
im_box->addDependentFloater(picker, TRUE, TRUE);
}
}
else
@ -534,15 +534,29 @@ void LLFloaterIMSessionTab::onRecentEmojiPicked(const LLSD& value)
}
}
// static
void LLFloaterIMSessionTab::onEmojiPicked(llwchar emoji)
{
mInputEditor->insertEmoji(emoji);
mInputEditor->setFocus(TRUE);
if (LLFloaterIMContainer* im_box = LLFloaterIMContainer::findInstance())
{
if (LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(im_box->getSelectedSession()))
{
session_floater->mInputEditor->insertEmoji(emoji);
session_floater->mInputEditor->setFocus(TRUE);
}
}
}
// static
void LLFloaterIMSessionTab::onEmojiPickerClosed()
{
mInputEditor->setFocus(TRUE);
if (LLFloaterIMContainer* im_box = LLFloaterIMContainer::findInstance())
{
if (LLFloaterIMSessionTab* session_floater = LLFloaterIMSessionTab::findConversation(im_box->getSelectedSession()))
{
session_floater->mInputEditor->setFocus(TRUE);
}
}
}
void LLFloaterIMSessionTab::closeFloater(bool app_quitting)

View File

@ -216,11 +216,11 @@ private:
void onInputEditorClicked();
static void onEmojiRecentPanelToggleBtnClicked(LLFloaterIMSessionTab* self);
static void onEmojiPickerToggleBtnClicked(LLFloaterIMSessionTab* self);
static void onEmojiPickerToggleBtnClicked();
void initEmojiRecentPanel(bool moveFocus);
void onRecentEmojiPicked(const LLSD& value);
void onEmojiPicked(llwchar emoji);
void onEmojiPickerClosed();
static void onEmojiPicked(llwchar emoji);
static void onEmojiPickerClosed();
bool checkIfTornOff();
bool mIsHostAttached;