Skip to content
Snippets Groups Projects
Commit fb78a0ca authored by Gilbert Gonzales's avatar Gilbert Gonzales
Browse files

merge

parents abf1bf79 bbfd1c0f
No related branches found
No related tags found
No related merge requests found
...@@ -30,6 +30,7 @@ ...@@ -30,6 +30,7 @@
#include "llfloaterimsessiontab.h" #include "llfloaterimsessiontab.h"
#include "llagent.h" #include "llagent.h"
#include "llagentcamera.h"
#include "llavataractions.h" #include "llavataractions.h"
#include "llchatentry.h" #include "llchatentry.h"
#include "llchathistory.h" #include "llchathistory.h"
...@@ -57,11 +58,12 @@ LLFloaterIMSessionTab::LLFloaterIMSessionTab(const LLSD& session_id) ...@@ -57,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);
...@@ -125,8 +127,12 @@ void LLFloaterIMSessionTab::setVisible(BOOL visible) ...@@ -125,8 +127,12 @@ void LLFloaterIMSessionTab::setVisible(BOOL visible)
if(visible && !mHasVisibleBeenInitialized) if(visible && !mHasVisibleBeenInitialized)
{ {
mHasVisibleBeenInitialized = true; mHasVisibleBeenInitialized = true;
LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container")->setVisible(true); if(!gAgentCamera.cameraMouselook())
{
LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container")->setVisible(true);
}
LLFloaterIMSessionTab::addToHost(mSessionID); LLFloaterIMSessionTab::addToHost(mSessionID);
mInputButtonPanel->setVisible(isTornOff());
} }
LLTransientDockableFloater::setVisible(visible); LLTransientDockableFloater::setVisible(visible);
...@@ -190,12 +196,29 @@ void LLFloaterIMSessionTab::addToHost(const LLUUID& session_id) ...@@ -190,12 +196,29 @@ void LLFloaterIMSessionTab::addToHost(const LLUUID& session_id)
} }
} }
void LLFloaterIMSessionTab::assignResizeLimits()
{
bool is_participants_pane_collapsed = mParticipantListPanel->isCollapsed();
// disable a layoutstack's functionality when participant list panel is collapsed
mRightPartPanel->setIgnoreReshape(is_participants_pane_collapsed);
S32 participants_pane_target_width = is_participants_pane_collapsed?
0 : (mParticipantListPanel->getRect().getWidth() + LLPANEL_BORDER_WIDTH);
S32 new_min_width = participants_pane_target_width + mRightPartPanel->getExpandedMinDim() + mFloaterExtraWidth;
setResizeLimits(new_min_width, getMinHeight());
this->mParticipantListAndHistoryStack->updateLayout();
}
BOOL LLFloaterIMSessionTab::postBuild() BOOL LLFloaterIMSessionTab::postBuild()
{ {
BOOL result; BOOL result;
mBodyStack = getChild<LLLayoutStack>("main_stack"); mBodyStack = getChild<LLLayoutStack>("main_stack");
mParticipantListAndHistoryStack = getChild<LLLayoutStack>("im_panels");
mCloseBtn = getChild<LLButton>("close_btn"); mCloseBtn = getChild<LLButton>("close_btn");
mCloseBtn->setCommitCallback(boost::bind(&LLFloater::onClickClose, this)); mCloseBtn->setCommitCallback(boost::bind(&LLFloater::onClickClose, this));
...@@ -212,6 +235,8 @@ BOOL LLFloaterIMSessionTab::postBuild() ...@@ -212,6 +235,8 @@ BOOL LLFloaterIMSessionTab::postBuild()
mGearBtn = getChild<LLButton>("gear_btn"); mGearBtn = getChild<LLButton>("gear_btn");
mParticipantListPanel = getChild<LLLayoutPanel>("speakers_list_panel"); mParticipantListPanel = getChild<LLLayoutPanel>("speakers_list_panel");
mRightPartPanel = getChild<LLLayoutPanel>("right_part_holder");
mToolbarPanel = getChild<LLLayoutPanel>("toolbar_panel"); mToolbarPanel = getChild<LLLayoutPanel>("toolbar_panel");
mContentPanel = getChild<LLLayoutPanel>("body_panel"); mContentPanel = getChild<LLLayoutPanel>("body_panel");
mInputButtonPanel = getChild<LLLayoutPanel>("input_button_layout_panel"); mInputButtonPanel = getChild<LLLayoutPanel>("input_button_layout_panel");
...@@ -232,12 +257,15 @@ BOOL LLFloaterIMSessionTab::postBuild() ...@@ -232,12 +257,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);
...@@ -288,6 +316,15 @@ BOOL LLFloaterIMSessionTab::postBuild() ...@@ -288,6 +316,15 @@ BOOL LLFloaterIMSessionTab::postBuild()
LLFloaterIMSessionTab::onSlide(this); LLFloaterIMSessionTab::onSlide(this);
} }
// The resize limits for LLFloaterIMSessionTab should be updated, based on current values of width of conversation and message panels
mParticipantListPanel->getResizeBar()->setResizeListener(boost::bind(&LLFloaterIMSessionTab::assignResizeLimits, this));
mFloaterExtraWidth =
getRect().getWidth()
- mParticipantListAndHistoryStack->getRect().getWidth()
- (mParticipantListPanel->isCollapsed()? 0 : LLPANEL_BORDER_WIDTH);
assignResizeLimits();
return result; return result;
} }
...@@ -660,8 +697,7 @@ void LLFloaterIMSessionTab::updateHeaderAndToolbar() ...@@ -660,8 +697,7 @@ void LLFloaterIMSessionTab::updateHeaderAndToolbar()
&& mIsParticipantListExpanded && mIsParticipantListExpanded
&& !mIsP2PChat; && !mIsP2PChat;
mParticipantListPanel->setVisible(is_participant_list_visible); mParticipantListAndHistoryStack->collapsePanel(mParticipantListPanel, !is_participant_list_visible);
// Display collapse image (<<) if the floater is hosted // Display collapse image (<<) if the floater is hosted
// or if it is torn off but has an open control panel. // or if it is torn off but has an open control panel.
...@@ -703,15 +739,11 @@ void LLFloaterIMSessionTab::forceReshape() ...@@ -703,15 +739,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)
...@@ -786,15 +818,18 @@ void LLFloaterIMSessionTab::onSlide(LLFloaterIMSessionTab* self) ...@@ -786,15 +818,18 @@ void LLFloaterIMSessionTab::onSlide(LLFloaterIMSessionTab* self)
{ {
if (!self->mIsP2PChat) if (!self->mIsP2PChat)
{ {
bool expand = !self->mParticipantListPanel->getVisible(); bool should_be_expanded = self->mParticipantListPanel->isCollapsed();
// Expand/collapse the IM control panel // Expand/collapse the participant list panel
self->mParticipantListPanel->setVisible(expand); self->mParticipantListAndHistoryStack->collapsePanel(self->mParticipantListPanel, !should_be_expanded);
gSavedSettings.setBOOL("IMShowControlPanel", expand); self->mParticipantListPanel->setVisible(should_be_expanded);
self->mIsParticipantListExpanded = expand; gSavedSettings.setBOOL("IMShowControlPanel", should_be_expanded);
self->mExpandCollapseBtn->setImageOverlay(self->getString(expand ? "collapse_icon" : "expand_icon")); self->mIsParticipantListExpanded = should_be_expanded;
self->mExpandCollapseBtn->setImageOverlay(self->getString(should_be_expanded ? "collapse_icon" : "expand_icon"));
} }
} }
self->assignResizeLimits();
} }
void LLFloaterIMSessionTab::onCollapseToLine(LLFloaterIMSessionTab* self) void LLFloaterIMSessionTab::onCollapseToLine(LLFloaterIMSessionTab* self)
......
...@@ -140,6 +140,9 @@ class LLFloaterIMSessionTab ...@@ -140,6 +140,9 @@ class LLFloaterIMSessionTab
void appendMessage(const LLChat& chat, const LLSD &args = 0); void appendMessage(const LLChat& chat, const LLSD &args = 0);
std::string appendTime(); std::string appendTime();
void assignResizeLimits();
S32 mFloaterExtraWidth;
bool mIsNearbyChat; bool mIsNearbyChat;
bool mIsP2PChat; bool mIsP2PChat;
...@@ -155,7 +158,9 @@ class LLFloaterIMSessionTab ...@@ -155,7 +158,9 @@ class LLFloaterIMSessionTab
LLUUID mSessionID; LLUUID mSessionID;
LLLayoutStack* mBodyStack; LLLayoutStack* mBodyStack;
LLLayoutStack* mParticipantListAndHistoryStack;
LLLayoutPanel* mParticipantListPanel; // add the widgets to that see mConversationsListPanel LLLayoutPanel* mParticipantListPanel; // add the widgets to that see mConversationsListPanel
LLLayoutPanel* mRightPartPanel;
LLLayoutPanel* mContentPanel; LLLayoutPanel* mContentPanel;
LLLayoutPanel* mToolbarPanel; LLLayoutPanel* mToolbarPanel;
LLLayoutPanel* mInputButtonPanel; LLLayoutPanel* mInputButtonPanel;
...@@ -168,7 +173,8 @@ class LLFloaterIMSessionTab ...@@ -168,7 +173,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 +201,7 @@ class LLFloaterIMSessionTab ...@@ -195,7 +201,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;
......
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
width="394" width="394"
can_resize="true" can_resize="true"
can_tear_off="false" can_tear_off="false"
min_width="340"
min_height="190" min_height="190"
positioning="relative"> positioning="relative">
<floater.string name="call_btn_start">Conv_toolbar_open_call</floater.string> <floater.string name="call_btn_start">Conv_toolbar_open_call</floater.string>
...@@ -223,9 +222,10 @@ ...@@ -223,9 +222,10 @@
<layout_panel <layout_panel
name="speakers_list_panel" name="speakers_list_panel"
follows="all" follows="all"
min_width="115" expanded_min_dim="115"
min_dim="0"
width="150" width="150"
height="275" height="275"
user_resize="true" user_resize="true"
auto_resize="false"> auto_resize="false">
</layout_panel> </layout_panel>
...@@ -241,7 +241,7 @@ ...@@ -241,7 +241,7 @@
user_resize="true" user_resize="true"
auto_resize="true" auto_resize="true"
visible="true" visible="true"
name="left_part_holder" name="right_part_holder"
min_width="221"> min_width="221">
<panel <panel
name="trnsAndChat_panel" name="trnsAndChat_panel"
...@@ -266,6 +266,7 @@ ...@@ -266,6 +266,7 @@
left="0"> left="0">
<layout_panel <layout_panel
auto_resize="false" auto_resize="false"
user_resize="false"
height="26" height="26"
layout="topleft" layout="topleft"
left_delta="0" left_delta="0"
...@@ -285,7 +286,6 @@ ...@@ -285,7 +286,6 @@
width="230" /> width="230" />
</layout_panel> </layout_panel>
<layout_panel <layout_panel
height="233"
width="210" width="210"
layout="topleft" layout="topleft"
follows="all" follows="all"
...@@ -293,19 +293,21 @@ ...@@ -293,19 +293,21 @@
top_delta="0" top_delta="0"
bottom="0" bottom="0"
visible="true" visible="true"
user_resize="true" user_resize="false"
auto_resize="true" auto_resize="true"
name="chat_holder"> name="chat_holder">
<chat_history <chat_history
font="SansSerifSmall" font="SansSerifSmall"
follows="all" follows="all"
visible="true" visible="true"
height="225"
name="chat_history" name="chat_history"
parse_highlights="true" parse_highlights="true"
parse_urls="true" parse_urls="true"
layout="topleft"
right="-5" right="-5"
left="5"> left="5"
top="0"
bottom="1">
</chat_history> </chat_history>
</layout_panel> </layout_panel>
</layout_stack> </layout_stack>
...@@ -348,7 +350,6 @@ ...@@ -348,7 +350,6 @@
auto_resize="true" auto_resize="true"
name="input_editor_layout_panel"> name="input_editor_layout_panel">
<chat_editor <chat_editor
top="6"
expand_lines_count="5" expand_lines_count="5"
follows="left|right|bottom" follows="left|right|bottom"
font="SansSerifSmall" font="SansSerifSmall"
...@@ -363,6 +364,7 @@ ...@@ -363,6 +364,7 @@
spellcheck="true" spellcheck="true"
tab_group="3" tab_group="3"
width="160" width="160"
top="6"
left="5" left="5"
right="-5" right="-5"
wrap="true"> wrap="true">
......
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