Skip to content
Snippets Groups Projects
Commit 4d9e3e15 authored by maksymsproductengine's avatar maksymsproductengine
Browse files

CHUI-855 FIXED Text entry bar auto expand does not resize

parent 9887daa3
No related branches found
No related tags found
No related merge requests found
...@@ -58,11 +58,12 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) ...@@ -58,11 +58,12 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id)
, mSpeakingIndicator(NULL) , mSpeakingIndicator(NULL)
, mChatHistory(NULL) , mChatHistory(NULL)
, mInputEditor(NULL) , mInputEditor(NULL)
, mInputEditorTopPad(0) , mInputEditorPad(0)
, mRefreshTimer(new LLTimer()) , mRefreshTimer(new LLTimer())
, mIsHostAttached(false) , mIsHostAttached(false)
, mHasVisibleBeenInitialized(false) , mHasVisibleBeenInitialized(false)
, mIsParticipantListExpanded(true) , mIsParticipantListExpanded(true)
, mChatLayoutPanel(NULL)
{ {
setAutoFocus(FALSE); setAutoFocus(FALSE);
mSession = LLIMModel::getInstance()->findIMSession(mSessionID); mSession = LLIMModel::getInstance()->findIMSession(mSessionID);
...@@ -237,12 +238,15 @@ BOOL LLFloaterIMSessionTab::postBuild() ...@@ -237,12 +238,15 @@ BOOL LLFloaterIMSessionTab::postBuild()
mChatHistory = getChild<LLChatHistory>("chat_history"); mChatHistory = getChild<LLChatHistory>("chat_history");
mInputEditor = getChild<LLChatEntry>("chat_editor"); 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->setCommitOnFocusLost( FALSE );
mInputEditor->setPassDelete(TRUE); mInputEditor->setPassDelete(TRUE);
mInputEditor->setFont(LLViewerChat::getChatFont()); mInputEditor->setFont(LLViewerChat::getChatFont());
mInputEditorTopPad = mChatHistory->getRect().mBottom - mInputEditor->getRect().mTop; mInputEditorPad = mChatLayoutPanel->getRect().getHeight() - mInputEditor->getRect().getHeight();
setOpenPositioning(LLFloaterEnums::POSITIONING_RELATIVE); setOpenPositioning(LLFloaterEnums::POSITIONING_RELATIVE);
...@@ -708,15 +712,11 @@ void LLFloaterIMSessionTab::forceReshape() ...@@ -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(); LLRect input_rect = mInputEditor->getRect();
mChatLayoutPanel->reshape(chat_layout_panel_rect.getWidth(), input_rect.getHeight() + mInputEditorPad, FALSE);
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 LLFloaterIMSessionTab::showTranslationCheckbox(BOOL show) void LLFloaterIMSessionTab::showTranslationCheckbox(BOOL show)
......
...@@ -168,7 +168,8 @@ class LLFloaterIMSessionTab ...@@ -168,7 +168,8 @@ class LLFloaterIMSessionTab
LLOutputMonitorCtrl* mSpeakingIndicator; LLOutputMonitorCtrl* mSpeakingIndicator;
LLChatHistory* mChatHistory; LLChatHistory* mChatHistory;
LLChatEntry* mInputEditor; 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* mExpandCollapseLineBtn;
LLButton* mExpandCollapseBtn; LLButton* mExpandCollapseBtn;
...@@ -195,7 +196,7 @@ class LLFloaterIMSessionTab ...@@ -195,7 +196,7 @@ class LLFloaterIMSessionTab
* and avoid overlapping, since input chat field can be vertically expanded. * and avoid overlapping, since input chat field can be vertically expanded.
* Implementation: chat history bottom "follows" top+top_pad of input chat field * Implementation: chat history bottom "follows" top+top_pad of input chat field
*/ */
void reshapeChatHistory(); void reshapeChatLayoutPanel();
bool checkIfTornOff(); bool checkIfTornOff();
bool mIsHostAttached; bool mIsHostAttached;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment