summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2013-03-21 18:33:29 -0700
committerMerov Linden <merov@lindenlab.com>2013-03-21 18:33:29 -0700
commit2e91033504a0e7ef43d28842c0e4a82dd01fa9d0 (patch)
tree27e81e43927f8a95144eb64f7eb6cafb2d0a5837 /indra/newview
parent6550f739cad56c8ff04eb0d334b34b20201124b5 (diff)
parentfb78a0cac235e8ee5ccbcb724f38ffa00ddfa930 (diff)
Pull merge from lindenlab/viewer-chui
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloaterimsessiontab.cpp50
-rw-r--r--indra/newview/llfloaterimsessiontab.h5
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_session.xml8
3 files changed, 49 insertions, 14 deletions
diff --git a/indra/newview/llfloaterimsessiontab.cpp b/indra/newview/llfloaterimsessiontab.cpp
index 0dd61568f9..eab2ce7798 100644
--- a/indra/newview/llfloaterimsessiontab.cpp
+++ b/indra/newview/llfloaterimsessiontab.cpp
@@ -196,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));
@@ -218,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");
@@ -297,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;
}
@@ -669,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.
@@ -791,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 e9393c5336..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;
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 1ad54bdb6b..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"