diff options
Diffstat (limited to 'indra/newview/llfloaterimsessiontab.cpp')
-rw-r--r-- | indra/newview/llfloaterimsessiontab.cpp | 32 |
1 files changed, 23 insertions, 9 deletions
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp index fcfd47b365..0cb3d9ab47 100644 --- a/indra/newview/llfloaterimsessiontab.cpp +++ b/indra/newview/llfloaterimsessiontab.cpp @@ -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) |