summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-03-21 20:46:00 -0400
committerOz Linden <oz@lindenlab.com>2013-03-21 20:46:00 -0400
commit82e297cf343151be116b59187b36b8a10b965250 (patch)
tree01dc0257f8a0c1633abc85b8c9ab89337eae18e7
parent43d7c80e8e2cd1cfe4e6c4214b4a4df9341d310b (diff)
parent06369c5707cd5418b6dedf43a2113482da666cf4 (diff)
merge changes for DRTVWR-304
-rw-r--r--.hgtags1
-rw-r--r--indra/llui/lltoolbar.cpp5
-rw-r--r--indra/newview/llfloaterimsessiontab.cpp77
-rw-r--r--indra/newview/llfloaterimsessiontab.h10
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_session.xml20
5 files changed, 78 insertions, 35 deletions
diff --git a/.hgtags b/.hgtags
index f006199e86..230d60fb81 100644
--- a/.hgtags
+++ b/.hgtags
@@ -427,3 +427,4 @@ c6b3561c7d7ad365eeba669db54eb57b5149ce75 3.5.0-beta2
f6ca5bb75bca975ff0bc77e71e615f6478c4559c 3.5.0-beta3
910b5fad950e343b58229f5a0aefa7729b9308b3 DRTVWR-303
53cffdde0b3cc367ba9bb6abd5c83ae14df5e882 3.5.0-beta4
+4d5f6234dc59a0fb6ead5e02c7d343a0610e0488 DRTVWR-304
diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp
index b9256dd890..1c74395c66 100644
--- a/indra/llui/lltoolbar.cpp
+++ b/indra/llui/lltoolbar.cpp
@@ -1059,10 +1059,9 @@ BOOL LLToolBar::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
// Convert drag position into insert position and rank
if (!isReadOnly() && handled && !drop)
{
- LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data;
- LLAssetType::EType type = inv_item->getType();
- if (type == LLAssetType::AT_WIDGET)
+ if (cargo_type == DAD_WIDGET)
{
+ LLInventoryItem* inv_item = (LLInventoryItem*)cargo_data;
LLCommandId dragged_command(inv_item->getUUID());
int orig_rank = getRankFromPosition(dragged_command);
mDragRank = getRankFromPosition(x, y);
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index 5df1a382cd..eab2ce7798 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -30,6 +30,7 @@
#include "llfloaterimsessiontab.h"
#include "llagent.h"
+#include "llagentcamera.h"
#include "llavataractions.h"
#include "llchatentry.h"
#include "llchathistory.h"
@@ -57,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);
@@ -125,8 +127,12 @@ void LLFloaterIMSessionTab::setVisible(BOOL visible)
if(visible && !mHasVisibleBeenInitialized)
{
mHasVisibleBeenInitialized = true;
- LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container")->setVisible(true);
+ if(!gAgentCamera.cameraMouselook())
+ {
+ LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container")->setVisible(true);
+ }
LLFloaterIMSessionTab::addToHost(mSessionID);
+ mInputButtonPanel->setVisible(isTornOff());
}
LLTransientDockableFloater::setVisible(visible);
@@ -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 result;
mBodyStack = getChild<LLLayoutStack>("main_stack");
-
+ mParticipantListAndHistoryStack = getChild<LLLayoutStack>("im_panels");
mCloseBtn = getChild<LLButton>("close_btn");
mCloseBtn->setCommitCallback(boost::bind(&LLFloater::onClickClose, this));
@@ -212,6 +235,8 @@ BOOL LLFloaterIMSessionTab::postBuild()
mGearBtn = getChild<LLButton>("gear_btn");
mParticipantListPanel = getChild<LLLayoutPanel>("speakers_list_panel");
+ mRightPartPanel = getChild<LLLayoutPanel>("right_part_holder");
+
mToolbarPanel = getChild<LLLayoutPanel>("toolbar_panel");
mContentPanel = getChild<LLLayoutPanel>("body_panel");
mInputButtonPanel = getChild<LLLayoutPanel>("input_button_layout_panel");
@@ -232,12 +257,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);
@@ -288,6 +316,15 @@ BOOL LLFloaterIMSessionTab::postBuild()
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;
}
@@ -660,8 +697,7 @@ void LLFloaterIMSessionTab::updateHeaderAndToolbar()
&& mIsParticipantListExpanded
&& !mIsP2PChat;
- mParticipantListPanel->setVisible(is_participant_list_visible);
-
+ mParticipantListAndHistoryStack->collapsePanel(mParticipantListPanel, !is_participant_list_visible);
// Display collapse image (<<) if the floater is hosted
// or if it is torn off but has an open control panel.
@@ -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();
-
- 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)
@@ -786,15 +818,18 @@ void LLFloaterIMSessionTab::onSlide(LLFloaterIMSessionTab* self)
{
if (!self->mIsP2PChat)
{
- bool expand = !self->mParticipantListPanel->getVisible();
-
- // Expand/collapse the IM control panel
- self->mParticipantListPanel->setVisible(expand);
- gSavedSettings.setBOOL("IMShowControlPanel", expand);
- self->mIsParticipantListExpanded = expand;
- self->mExpandCollapseBtn->setImageOverlay(self->getString(expand ? "collapse_icon" : "expand_icon"));
+ bool should_be_expanded = self->mParticipantListPanel->isCollapsed();
+
+ // Expand/collapse the participant list panel
+ self->mParticipantListAndHistoryStack->collapsePanel(self->mParticipantListPanel, !should_be_expanded);
+ self->mParticipantListPanel->setVisible(should_be_expanded);
+ gSavedSettings.setBOOL("IMShowControlPanel", should_be_expanded);
+ self->mIsParticipantListExpanded = should_be_expanded;
+ self->mExpandCollapseBtn->setImageOverlay(self->getString(should_be_expanded ? "collapse_icon" : "expand_icon"));
}
}
+
+ self->assignResizeLimits();
}
void LLFloaterIMSessionTab::onCollapseToLine(LLFloaterIMSessionTab* self)
diff --git a/indra/newview/llfloaterimsessiontab.h b/indra/newview/llfloaterimsessiontab.h
index f22e2b5744..f0899a3c09 100644
--- a/indra/newview/llfloaterimsessiontab.h
+++ b/indra/newview/llfloaterimsessiontab.h
@@ -140,6 +140,9 @@ protected:
void appendMessage(const LLChat& chat, const LLSD &args = 0);
std::string appendTime();
+ void assignResizeLimits();
+
+ S32 mFloaterExtraWidth;
bool mIsNearbyChat;
bool mIsP2PChat;
@@ -155,7 +158,9 @@ protected:
LLUUID mSessionID;
LLLayoutStack* mBodyStack;
+ LLLayoutStack* mParticipantListAndHistoryStack;
LLLayoutPanel* mParticipantListPanel; // add the widgets to that see mConversationsListPanel
+ LLLayoutPanel* mRightPartPanel;
LLLayoutPanel* mContentPanel;
LLLayoutPanel* mToolbarPanel;
LLLayoutPanel* mInputButtonPanel;
@@ -168,7 +173,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 +201,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;
diff --git a/indra/newview/skins/default/xui/en/floater_im_session.xml b/indra/newview/skins/default/xui/en/floater_im_session.xml
index e081ea8e74..d8b085063f 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -14,7 +14,6 @@
width="394"
can_resize="true"
can_tear_off="false"
- min_width="340"
min_height="190"
positioning="relative">
<floater.string name="call_btn_start">Conv_toolbar_open_call</floater.string>
@@ -223,9 +222,10 @@
<layout_panel
name="speakers_list_panel"
follows="all"
- min_width="115"
+ expanded_min_dim="115"
+ min_dim="0"
width="150"
- height="275"
+ height="275"
user_resize="true"
auto_resize="false">
</layout_panel>
@@ -241,7 +241,7 @@
user_resize="true"
auto_resize="true"
visible="true"
- name="left_part_holder"
+ name="right_part_holder"
min_width="221">
<panel
name="trnsAndChat_panel"
@@ -266,6 +266,7 @@
left="0">
<layout_panel
auto_resize="false"
+ user_resize="false"
height="26"
layout="topleft"
left_delta="0"
@@ -285,7 +286,6 @@
width="230" />
</layout_panel>
<layout_panel
- height="233"
width="210"
layout="topleft"
follows="all"
@@ -293,19 +293,21 @@
top_delta="0"
bottom="0"
visible="true"
- user_resize="true"
+ user_resize="false"
auto_resize="true"
name="chat_holder">
<chat_history
font="SansSerifSmall"
follows="all"
visible="true"
- height="225"
name="chat_history"
parse_highlights="true"
parse_urls="true"
+ layout="topleft"
right="-5"
- left="5">
+ left="5"
+ top="0"
+ bottom="1">
</chat_history>
</layout_panel>
</layout_stack>
@@ -348,7 +350,6 @@
auto_resize="true"
name="input_editor_layout_panel">
<chat_editor
- top="6"
expand_lines_count="5"
follows="left|right|bottom"
font="SansSerifSmall"
@@ -363,6 +364,7 @@
spellcheck="true"
tab_group="3"
width="160"
+ top="6"
left="5"
right="-5"
wrap="true">