summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authormaksymsproductengine <maksymsproductengine@lindenlab.com>2013-03-21 18:29:18 +0200
committermaksymsproductengine <maksymsproductengine@lindenlab.com>2013-03-21 18:29:18 +0200
commit4d9e3e159e63a0317a069c9d74c6904d5b222537 (patch)
tree4998f3121d7b8c0f734f5539165841f37256dc06 /indra/newview
parent9887daa3e3224b00ffc46ce69604b3227b14637c (diff)
CHUI-855 FIXED Text entry bar auto expand does not resize
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloaterimsessiontab.cpp20
-rw-r--r--indra/newview/llfloaterimsessiontab.h5
2 files changed, 13 insertions, 12 deletions
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index 7b50ce5ae2..0dd61568f9 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -58,11 +58,12 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id)
, mSpeakingIndicator(NULL)
, mChatHistory(NULL)
, mInputEditor(NULL)
- , mInputEditorTopPad(0)
+ , mInputEditorPad(0)
, mRefreshTimer(new LLTimer())
, mIsHostAttached(false)
, mHasVisibleBeenInitialized(false)
, mIsParticipantListExpanded(true)
+ , mChatLayoutPanel(NULL)
{
setAutoFocus(FALSE);
mSession = LLIMModel::getInstance()->findIMSession(mSessionID);
@@ -237,12 +238,15 @@ BOOL LLFloaterIMSessionTab::postBuild()
mChatHistory = getChild<LLChatHistory>("chat_history");
mInputEditor = getChild<LLChatEntry>("chat_editor");
- mInputEditor->setTextExpandedCallback(boost::bind(&LLFloaterIMSessionTab::reshapeChatHistory, this));
+
+ mChatLayoutPanel = getChild<LLLayoutPanel>("chat_layout_panel");
+
+ mInputEditor->setTextExpandedCallback(boost::bind(&LLFloaterIMSessionTab::reshapeChatLayoutPanel, this));
mInputEditor->setCommitOnFocusLost( FALSE );
mInputEditor->setPassDelete(TRUE);
mInputEditor->setFont(LLViewerChat::getChatFont());
- mInputEditorTopPad = mChatHistory->getRect().mBottom - mInputEditor->getRect().mTop;
+ mInputEditorPad = mChatLayoutPanel->getRect().getHeight() - mInputEditor->getRect().getHeight();
setOpenPositioning(LLFloaterEnums::POSITIONING_RELATIVE);
@@ -708,15 +712,11 @@ void LLFloaterIMSessionTab::forceReshape()
}
-void LLFloaterIMSessionTab::reshapeChatHistory()
+void LLFloaterIMSessionTab::reshapeChatLayoutPanel()
{
- LLRect chat_rect = mChatHistory->getRect();
+ LLRect chat_layout_panel_rect = mChatLayoutPanel->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);
+ mChatLayoutPanel->reshape(chat_layout_panel_rect.getWidth(), input_rect.getHeight() + mInputEditorPad, FALSE);
}
void LLFloaterIMSessionTab::showTranslationCheckbox(BOOL show)
diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h
index f22e2b5744..e9393c5336 100644
--- a/indra/newview/llfloaterimsessiontab.h
+++ b/indra/newview/llfloaterimsessiontab.h
@@ -168,7 +168,8 @@ protected:
LLOutputMonitorCtrl* mSpeakingIndicator;
LLChatHistory* mChatHistory;
LLChatEntry* mInputEditor;
- int mInputEditorTopPad; // padding between input field and chat history
+ LLLayoutPanel * mChatLayoutPanel;
+ int mInputEditorPad; // padding between input field and chat history
LLButton* mExpandCollapseLineBtn;
LLButton* mExpandCollapseBtn;
@@ -195,7 +196,7 @@ private:
* and avoid overlapping, since input chat field can be vertically expanded.
* Implementation: chat history bottom "follows" top+top_pad of input chat field
*/
- void reshapeChatHistory();
+ void reshapeChatLayoutPanel();
bool checkIfTornOff();
bool mIsHostAttached;