summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/llfloater.cpp4
-rw-r--r--indra/newview/llimfloater.cpp46
-rw-r--r--indra/newview/llimfloater.h2
-rw-r--r--indra/newview/llimfloatercontainer.cpp24
-rw-r--r--indra/newview/llimfloatercontainer.h1
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_container.xml111
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_session.xml158
7 files changed, 281 insertions, 65 deletions
diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp
index 51611d547c..b087205a5c 100644
--- a/indra/llui/llfloater.cpp
+++ b/indra/llui/llfloater.cpp
@@ -1371,7 +1371,7 @@ void LLFloater::setHost(LLMultiFloater* host)
mButtonScale = 1.f;
//mButtonsEnabled[BUTTON_TEAR_OFF] = FALSE;
}
- updateTitleButtons();
+
if (host)
{
mHostHandle = host->getHandle();
@@ -1381,6 +1381,8 @@ void LLFloater::setHost(LLMultiFloater* host)
{
mHostHandle.markDead();
}
+
+ updateTitleButtons();
}
void LLFloater::moveResizeHandlesToFront()
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index f743b5e2bf..df3521ecb0 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -28,6 +28,7 @@
#include "llimfloater.h"
+#include "lldraghandle.h"
#include "llnotificationsutil.h"
#include "llagent.h"
@@ -251,6 +252,12 @@ BOOL LLIMFloater::postBuild()
slide_right->setVisible(!mControlPanel->getParent()->getVisible());
slide_right->setClickedCallback(boost::bind(&LLIMFloater::onSlide, this));
+ LLButton* return_btn = getChild<LLButton>("return_btn");
+ return_btn->setCommitCallback(boost::bind(&LLFloater::onClickTearOff, this));
+
+ LLButton* tear_off_btn = getChild<LLButton>("tear_off_btn");
+ tear_off_btn->setCommitCallback(boost::bind(&LLFloater::onClickTearOff, this));
+
mInputEditor = getChild<LLLineEditor>("chat_editor");
mInputEditor->setMaxTextLength(1023);
// enable line history support for instant message bar
@@ -1194,3 +1201,42 @@ void LLIMFloater::onClickCloseBtn()
LLFloater::onClickCloseBtn();
}
+
+// virtual
+void LLIMFloater::updateTitleButtons()
+{
+ if (!mDragHandle)
+ {
+ return;
+ }
+
+ LLMultiFloater* host_floater = getHost();
+
+ bool is_hosted = host_floater != NULL;
+ if (is_hosted) ///< floater is hosted
+ {
+ for (S32 i = 0; i < BUTTON_COUNT; i++)
+ {
+ if (!mButtons[i])
+ {
+ continue;
+ }
+
+ // Hide the standard header buttons in a docked IM floater.
+ mButtons[i]->setVisible(false);
+ }
+ }
+ else ///< floater is torn off
+ {
+ LLFloater::updateTitleButtons();
+ }
+
+ // toggle floater's drag handle and title visibility
+ mDragHandle->setVisible(!is_hosted);
+
+ LLButton* return_btn = getChild<LLButton>("return_btn");
+ return_btn->setVisible(!is_hosted);
+
+ LLButton* tear_off_btn = getChild<LLButton>("tear_off_btn");
+ tear_off_btn->setVisible(is_hosted);
+}
diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h
index f7cd35b5eb..95aa214ff6 100644
--- a/indra/newview/llimfloater.h
+++ b/indra/newview/llimfloater.h
@@ -120,6 +120,8 @@ protected:
/* virtual */
void onClickCloseBtn();
+ /*virtual*/ void updateTitleButtons();
+
private:
// process focus events to set a currently active session
/* virtual */ void onFocusLost();
diff --git a/indra/newview/llimfloatercontainer.cpp b/indra/newview/llimfloatercontainer.cpp
index c8e48b0d42..9b5055fb98 100644
--- a/indra/newview/llimfloatercontainer.cpp
+++ b/indra/newview/llimfloatercontainer.cpp
@@ -56,6 +56,9 @@ BOOL LLIMFloaterContainer::postBuild()
mNewMessageConnection = LLIMModel::instance().mNewMsgSignal.connect(boost::bind(&LLIMFloaterContainer::onNewMessageReceived, this, _1));
// Do not call base postBuild to not connect to mCloseSignal to not close all floaters via Close button
// mTabContainer will be initialized in LLMultiFloater::addChild()
+
+ setTabContainer(getChild<LLTabContainer>("im_box_tab_container"));
+
return TRUE;
}
@@ -74,6 +77,7 @@ void LLIMFloaterContainer::onOpen(const LLSD& key)
*/
}
+// virtual
void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
BOOL select_added_floater,
LLTabContainer::eInsertionPoint insertion_point)
@@ -89,6 +93,12 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
LLMultiFloater::addFloater(floaterp, select_added_floater, insertion_point);
+ LLView* floater_contents = floaterp->getChild<LLView>("contents_view");
+
+ // we don't show the header when the floater is hosted,
+ // so reshape floater contents to occupy the header space
+ floater_contents->setShape(floaterp->getRect());
+
LLUUID session_id = floaterp->getKey();
LLIconCtrl* icon = 0;
@@ -116,6 +126,20 @@ void LLIMFloaterContainer::addFloater(LLFloater* floaterp,
mTabContainer->setTabImage(floaterp, icon);
}
+// virtual
+void LLIMFloaterContainer::removeFloater(LLFloater* floaterp)
+{
+ LLMultiFloater::removeFloater(floaterp);
+
+ LLRect contents_rect = floaterp->getRect();
+
+ // reduce the floater contents height by header height
+ contents_rect.mTop -= floaterp->getHeaderHeight();
+
+ LLView* floater_contents = floaterp->getChild<LLView>("contents_view");
+ floater_contents->setShape(contents_rect);
+}
+
void LLIMFloaterContainer::onCloseFloater(LLUUID& id)
{
mSessions.erase(id);
diff --git a/indra/newview/llimfloatercontainer.h b/indra/newview/llimfloatercontainer.h
index 892ecef48d..93b91fe3cf 100644
--- a/indra/newview/llimfloatercontainer.h
+++ b/indra/newview/llimfloatercontainer.h
@@ -50,6 +50,7 @@ public:
/*virtual*/ void addFloater(LLFloater* floaterp,
BOOL select_added_floater,
LLTabContainer::eInsertionPoint insertion_point = LLTabContainer::END);
+ /*virtual*/ void removeFloater(LLFloater* floaterp);
static LLFloater* getCurrentVoiceFloater();
diff --git a/indra/newview/skins/default/xui/en/floater_im_container.xml b/indra/newview/skins/default/xui/en/floater_im_container.xml
index e123de46c2..d19b36971f 100644
--- a/indra/newview/skins/default/xui/en/floater_im_container.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_container.xml
@@ -3,47 +3,86 @@
can_close="false"
can_minimize="true"
can_resize="true"
- height="390"
+ height="430"
layout="topleft"
+ min_width="510"
name="floater_im_box"
help_topic="floater_im_box"
save_rect="true"
save_visibility="true"
single_instance="true"
title="CONVERSATIONS"
- width="396">
- <tab_container
- follows="left|right|top|bottom"
- height="390"
- layout="topleft"
- left="1"
- name="im_box_tab_container"
- tab_position="bottom"
- tab_width="64"
- tab_max_width = "134"
- tab_height="16"
- use_custom_icon_ctrl="true"
- tab_icon_ctrl_pad="2"
- halign="left"
- use_ellipses="true"
- top="0"
- width="394">
- <first_tab
- tab_bottom_image_flash="Toolbar_Left_Flash"/>
- <middle_tab
- tab_bottom_image_flash="Toolbar_Middle_Flash"/>
- <last_tab
- tab_bottom_image_flash="Toolbar_Right_Flash"/>
- </tab_container>
- <icon
- color="DefaultShadowLight"
- enabled="false"
- follows="left|right|bottom"
- height="17"
- image_name="tabarea.tga"
- layout="bottomleft"
- left="1"
- name="im_box_tab_container_icon"
- bottom="10"
- width="394" />
+ width="680">
+ <panel
+ border="true"
+ follows="top|bottom|left"
+ layout="topleft"
+ name="conversations_list"
+ opaque="true"
+ top="0"
+ left="5"
+ height="425"
+ width="263">
+ <menu_button
+ follows="top|left"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="OptionsMenu_Off"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ left="5"
+ name="sort_btn"
+ top="5"
+ width="31" />
+ <button
+ follows="top|left"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="AddItem_Off"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ top="5"
+ left_pad="4"
+ name="add_btn"
+ tool_tip="Add button on the left panel"
+ width="31">
+ </button>
+ <button
+ follows="right|top"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="TabIcon_Open_Off"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ top="5"
+ left="228"
+ name="slide_left_btn"
+ width="31" />
+ <button
+ follows="right|top"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="TabIcon_Close_Off"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ top="5"
+ left_delta="0"
+ name="slide_right_btn"
+ width="31" />
+ </panel>
+ <panel_container
+ follows="all"
+ layout="topleft"
+ name="im_box_tab_container"
+ opaque="true"
+ top="0"
+ left_pad="15"
+ height="430"
+ width="389"
+ min_width="290">
+ </panel_container>
</multi_floater>
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 ca73883e53..3c3f4ad0e2 100644
--- a/indra/newview/skins/default/xui/en/floater_im_session.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_session.xml
@@ -1,6 +1,5 @@
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<floater
- legacy_header_height="18"
background_visible="true"
default_tab_group="1"
height="355"
@@ -15,28 +14,147 @@
can_resize="true"
min_width="250"
min_height="190">
+ <view
+ follows="all"
+ layout="topleft"
+ name="contents_view"
+ top="0"
+ left="0"
+ height="355"
+ width="394">
+ <panel
+ follows="all"
+ layout="topleft"
+ name="toolbar_panel"
+ top="0"
+ left="0"
+ height="35"
+ width="394">
+ <menu_button
+ follows="top|left"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="OptionsMenu_Off"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ left="5"
+ name="view_options_btn"
+ top="5"
+ width="31" />
+ <button
+ follows="top|left"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="AddItem_Off"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ top="5"
+ left_pad="4"
+ name="add_btn"
+ width="31">
+ <commit_callback
+ function="Chats.add" />
+ </button>
+ <button
+ follows="top|left"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="VoicePTT_Off"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ top="5"
+ left_pad="4"
+ name="call"
+ width="31">
+ <commit_callback
+ function="Chats.add" />
+ </button>
+ <button
+ follows="right|top"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="Icon_Close_Foreground"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ top="5"
+ left="283"
+ name="close_btn"
+ width="31" />
+ <button
+ follows="right|top"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="TabIcon_Open_Off"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ top="5"
+ left_pad="5"
+ name="slide_left_btn"
+ width="31" />
+ <button
+ follows="right|top"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="TabIcon_Close_Off"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ top="5"
+ left_delta="0"
+ name="slide_right_btn"
+ width="31" />
+ <button
+ follows="right|top"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="tearoffbox.tga"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ top="5"
+ left_pad="5"
+ name="tear_off_btn"
+ width="31" />
+ <button
+ follows="right|top"
+ height="25"
+ image_hover_unselected="Toolbar_Middle_Over"
+ image_overlay="Icon_Dock_Foreground"
+ image_selected="Toolbar_Middle_Selected"
+ image_unselected="Toolbar_Middle_Off"
+ layout="topleft"
+ top="5"
+ left_delta="0"
+ name="return_btn"
+ width="31" />
+ </panel>
<layout_stack
animate="true"
default_tab_group="2"
follows="all"
- height="320"
+ height="310"
width="394"
layout="topleft"
orientation="horizontal"
name="im_panels"
tab_group="1"
- top="20"
+ top_pad="0"
left="0">
<layout_panel
name="im_control_panel_holder"
min_width="115"
width="150"
- height="320"
+ height="310"
auto_resize="false">
<panel
name="panel_im_control_panel"
layout="topleft"
- height="320"
+ height="310"
width="150"
follows="all"/>
</layout_panel>
@@ -46,39 +164,22 @@
tab_group="2"
top="0"
height="200"
- width="254"
+ width="254"
user_resize="true">
- <button
- height="20"
- follows="left|top"
- top="0"
- left="2"
- image_overlay="TabIcon_Open_Off"
- layout="topleft"
- width="25"
- name="slide_left_btn" />
- <button
- height="20"
- follows="left|top"
- top="0"
- left="2"
- image_overlay="TabIcon_Close_Off"
- width="25"
- name="slide_right_btn" />
<chat_history
- font="SansSerifSmall"
- follows="left|right|top|bottom"
- height="150"
+ font="SansSerifSmall"
+ follows="all"
+ height="170"
name="chat_history"
parse_highlights="true"
parse_urls="true"
- left="1"
+ left="1"
width="249">
</chat_history>
<line_editor
bottom="0"
follows="left|right|bottom"
- font="SansSerifSmall"
+ font="SansSerifSmall"
height="20"
label="To"
layout="bottomleft"
@@ -88,4 +189,5 @@
</line_editor>
</layout_panel>
</layout_stack>
+ </view>
</floater>