diff options
| author | Alexander Gavriliuk <alexandrgproductengine@lindenlab.com> | 2023-11-10 02:58:01 +0100 | 
|---|---|---|
| committer | Guru <alexandrgproductengine@lindenlab.com> | 2023-11-10 03:38:44 +0100 | 
| commit | 1ef524986f598038c5ebdd38ea17d2f5a56c0626 (patch) | |
| tree | 339386516d2977209fb6d7991ce65149823efc9e /indra | |
| parent | 88b15ff62c5225f48d60d5d49dafbd32417856c7 (diff) | |
SL-20416 Choose emoji floater puts emoji in the chat window that opened it
Diffstat (limited to 'indra')
| -rw-r--r-- | indra/newview/llfloaterimsessiontab.cpp | 32 | ||||
| -rw-r--r-- | indra/newview/llfloaterimsessiontab.h | 6 | 
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;  | 
