diff options
Diffstat (limited to 'indra/newview/llimconversation.cpp')
-rw-r--r-- | indra/newview/llimconversation.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/indra/newview/llimconversation.cpp b/indra/newview/llimconversation.cpp index f12821352b..bbbc9fcffd 100644 --- a/indra/newview/llimconversation.cpp +++ b/indra/newview/llimconversation.cpp @@ -29,6 +29,8 @@ #include "llimconversation.h" +#include "llchatentry.h" +#include "llchathistory.h" #include "lldraghandle.h" #include "llfloaterreg.h" #include "llimfloater.h" @@ -47,6 +49,9 @@ LLIMConversation::LLIMConversation(const LLUUID& session_id) , mCloseBtn(NULL) , mSessionID(session_id) , mParticipantList(NULL) + , mChatHistory(NULL) + , mInputEditor(NULL) + , mInputEditorTopPad(0) { mCommitCallbackRegistrar.add("IMSession.Menu.Action", boost::bind(&LLIMConversation::onIMSessionMenuItemClicked, this, _2)); @@ -86,6 +91,12 @@ BOOL LLIMConversation::postBuild() mTearOffBtn = getChild<LLButton>("tear_off_btn"); mTearOffBtn->setCommitCallback(boost::bind(&LLIMConversation::onTearOffClicked, this)); + mChatHistory = getChild<LLChatHistory>("chat_history"); + mInputEditor = getChild<LLChatEntry>("chat_editor"); + + mInputEditor->setTextExpandedCallback(boost::bind(&LLIMConversation::reshapeChatHistory, this)); + mInputEditorTopPad = mChatHistory->getRect().mBottom - mInputEditor->getRect().mTop; + if (!getTornOff()) { setOpenPositioning(LLFloaterEnums::POSITIONING_RELATIVE); @@ -242,6 +253,17 @@ void LLIMConversation::updateHeaderAndToolbar() showTranslationCheckbox(); } +void LLIMConversation::reshapeChatHistory() +{ + LLRect chat_rect = mChatHistory->getRect(); + LLRect input_rect = mInputEditor->getRect(); + + int delta_height = chat_rect.mBottom - (input_rect.mTop + mInputEditorTopPad); + + chat_rect.setLeftTopAndSize(chat_rect.mLeft, chat_rect.mTop, chat_rect.getWidth(), chat_rect.getHeight() + delta_height); + mChatHistory->setShape(chat_rect); +} + void LLIMConversation::showTranslationCheckbox(BOOL show) { getChild<LLUICtrl>("translate_chat_checkbox_lp")->setVisible(mIsNearbyChat? show : FALSE); |