summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloaterimsessiontab.cpp32
-rw-r--r--indra/newview/llfloaterimsessiontab.h6
2 files changed, 26 insertions, 12 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)
diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h
index 1b34b242c7..ddffed57a3 100644
--- a/indra/newview/llfloaterimsessiontab.h
+++ b/indra/newview/llfloaterimsessiontab.h
@@ -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;