summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authormaksymsproductengine <maksymsproductengine@lindenlab.com>2012-12-15 21:28:38 +0200
committermaksymsproductengine <maksymsproductengine@lindenlab.com>2012-12-15 21:28:38 +0200
commit01bdfb3ecb88ce71078494274a8d7835d181c50e (patch)
tree9067cd1b8c99b40ca89e018bc498d13896a0f1d9 /indra/newview
parentf8b51f40289255ce38f65830f5bb0f29def3b757 (diff)
CHUI-591 FIXED Issues with resizing conversations floater
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llfloaterimcontainer.cpp35
-rw-r--r--indra/newview/llfloaterimcontainer.h3
-rw-r--r--indra/newview/llfloaterimnearbychat.cpp24
-rw-r--r--indra/newview/llfloaterimnearbychat.h4
-rw-r--r--indra/newview/skins/default/xui/en/floater_im_container.xml31
5 files changed, 43 insertions, 54 deletions
diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp
index 3c85f21188..ba5ec363d6 100644
--- a/indra/newview/llfloaterimcontainer.cpp
+++ b/indra/newview/llfloaterimcontainer.cpp
@@ -51,8 +51,8 @@
#include "llconversationview.h"
#include "llcallbacklist.h"
#include "llworld.h"
-
#include "llsdserialize.h"
+
//
// LLFloaterIMContainer
//
@@ -171,6 +171,9 @@ BOOL LLFloaterIMContainer::postBuild()
// Open IM session with selected participant on double click event
mConversationsListPanel->setDoubleClickCallback(boost::bind(&LLFloaterIMContainer::doToSelected, this, LLSD("im")));
+ // The resize limits for LLFloaterIMContainer should be updated, based on current values of width of conversation and message panels
+ mConversationsPane->getResizeBar()->setResizeListener(boost::bind(&LLFloaterIMContainer::assignResizeLimits, this));
+
// Create the root model and view for all conversation sessions
LLConversationItem* base_item = new LLConversationItem(getRootViewModel());
@@ -247,6 +250,7 @@ void LLFloaterIMContainer::onOpen(const LLSD& key)
{
LLMultiFloater::onOpen(key);
openNearbyChat();
+ assignResizeLimits();
}
// virtual
@@ -308,26 +312,6 @@ void LLFloaterIMContainer::onCloseFloater(LLUUID& id)
setFocus(TRUE);
}
-// virtual
-void LLFloaterIMContainer::computeResizeLimits(S32& new_min_width, S32& new_min_height)
-{
- // possibly increase floater's minimum height according to children's minimums
- for (S32 tab_idx = 0; tab_idx < mTabContainer->getTabCount(); ++tab_idx)
- {
- LLFloater* floaterp = dynamic_cast<LLFloater*>(mTabContainer->getPanelByIndex(tab_idx));
- if (floaterp)
- {
- new_min_height = llmax(new_min_height, floaterp->getMinHeight());
- }
- }
-
- S32 conversations_pane_min_dim = mConversationsPane->getRelevantMinDim();
- S32 messages_pane_min_dim = mMessagesPane->getRelevantMinDim();
-
- // set floater's minimum width according to relevant minimal children's dimensionals
- new_min_width = conversations_pane_min_dim + messages_pane_min_dim + LLPANEL_BORDER_WIDTH*2;
-}
-
void LLFloaterIMContainer::onNewMessageReceived(const LLSD& data)
{
LLUUID session_id = data["session_id"].asUUID();
@@ -728,6 +712,15 @@ void LLFloaterIMContainer::updateState(bool collapse, S32 delta_width)
setResizeLimits(expanded_min_size, expanded_min_size);
}
+ assignResizeLimits();
+}
+
+void LLFloaterIMContainer::assignResizeLimits()
+{
+ const LLRect& conv_rect = mConversationsPane->isCollapsed() ? LLRect() : mConversationsPane->getRect();
+ S32 msg_limits = mMessagesPane->isCollapsed() ? 0 : mMessagesPane->getExpandedMinDim();
+ S32 x_limits = conv_rect.getWidth() + msg_limits;
+ setResizeLimits(x_limits + LLPANEL_BORDER_WIDTH * 3, getMinHeight());
}
void LLFloaterIMContainer::onAddButtonClicked()
diff --git a/indra/newview/llfloaterimcontainer.h b/indra/newview/llfloaterimcontainer.h
index 1a3e64f759..5db1565cea 100644
--- a/indra/newview/llfloaterimcontainer.h
+++ b/indra/newview/llfloaterimcontainer.h
@@ -110,7 +110,7 @@ private:
avatarID_panel_map_t mSessions;
boost::signals2::connection mNewMessageConnection;
- /*virtual*/ void computeResizeLimits(S32& new_min_width, S32& new_min_height);
+ /*virtual*/ void computeResizeLimits(S32& new_min_width, S32& new_min_height) {}
void onNewMessageReceived(const LLSD& data);
@@ -153,6 +153,7 @@ private:
void toggleAllowTextChat(const LLUUID& participant_uuid);
void toggleMute(const LLUUID& participant_id, U32 flags);
void openNearbyChat();
+ void assignResizeLimits();
LLButton* mExpandCollapseBtn;
LLButton* mStubCollapseBtn;
diff --git a/indra/newview/llfloaterimnearbychat.cpp b/indra/newview/llfloaterimnearbychat.cpp
index a9a3611970..797d590e1f 100644
--- a/indra/newview/llfloaterimnearbychat.cpp
+++ b/indra/newview/llfloaterimnearbychat.cpp
@@ -113,8 +113,8 @@ BOOL LLFloaterIMNearbyChat::postBuild()
BOOL result = LLFloaterIMSessionTab::postBuild();
mInputEditor->setCommitCallback(boost::bind(&LLFloaterIMNearbyChat::onChatBoxCommit, this));
- mInputEditor->setKeystrokeCallback(boost::bind(&onChatBoxKeystroke, _1, this));
- mInputEditor->setFocusLostCallback(boost::bind(&onChatBoxFocusLost, _1, this));
+ mInputEditor->setKeystrokeCallback(boost::bind(&LLFloaterIMNearbyChat::onChatBoxKeystroke, this));
+ mInputEditor->setFocusLostCallback(boost::bind(&LLFloaterIMNearbyChat::onChatBoxFocusLost, this));
mInputEditor->setFocusReceivedCallback(boost::bind(&LLFloaterIMNearbyChat::onChatBoxFocusReceived, this));
mInputEditor->setLabel(LLTrans::getString("NearbyChatTitle"));
@@ -354,13 +354,11 @@ BOOL LLFloaterIMNearbyChat::matchChatTypeTrigger(const std::string& in_str, std:
return string_was_found;
}
-void LLFloaterIMNearbyChat::onChatBoxKeystroke(LLTextEditor* caller, void* userdata)
+void LLFloaterIMNearbyChat::onChatBoxKeystroke()
{
LLFirstUse::otherAvatarChatFirst(false);
- LLFloaterIMNearbyChat* self = (LLFloaterIMNearbyChat *)userdata;
-
- LLWString raw_text = self->mInputEditor->getWText();
+ LLWString raw_text = mInputEditor->getWText();
// Can't trim the end, because that will cause autocompletion
// to eat trailing spaces that might be part of a gesture.
@@ -386,8 +384,8 @@ void LLFloaterIMNearbyChat::onChatBoxKeystroke(LLTextEditor* caller, void* userd
// the selection will already be deleted, but we need to trim
// off the character before
std::string new_text = raw_text.substr(0, length-1);
- self->mInputEditor->setText( new_text );
- self->mInputEditor->setCursorToEnd();
+ mInputEditor->setText( new_text );
+ mInputEditor->setCursorToEnd();
length = length - 1;
}
*/
@@ -407,17 +405,17 @@ void LLFloaterIMNearbyChat::onChatBoxKeystroke(LLTextEditor* caller, void* userd
if (LLGestureMgr::instance().matchPrefix(utf8_trigger, &utf8_out_str))
{
std::string rest_of_match = utf8_out_str.substr(utf8_trigger.size());
- self->mInputEditor->setText(utf8_trigger + rest_of_match); // keep original capitalization for user-entered part
+ mInputEditor->setText(utf8_trigger + rest_of_match); // keep original capitalization for user-entered part
// Select to end of line, starting from the character
// after the last one the user typed.
- self->mInputEditor->selectNext(rest_of_match, false);
+ mInputEditor->selectNext(rest_of_match, false);
}
else if (matchChatTypeTrigger(utf8_trigger, &utf8_out_str))
{
std::string rest_of_match = utf8_out_str.substr(utf8_trigger.size());
- self->mInputEditor->setText(utf8_trigger + rest_of_match + " "); // keep original capitalization for user-entered part
- self->mInputEditor->endOfDoc();
+ mInputEditor->setText(utf8_trigger + rest_of_match + " "); // keep original capitalization for user-entered part
+ mInputEditor->endOfDoc();
}
//llinfos << "GESTUREDEBUG " << trigger
@@ -428,7 +426,7 @@ void LLFloaterIMNearbyChat::onChatBoxKeystroke(LLTextEditor* caller, void* userd
}
// static
-void LLFloaterIMNearbyChat::onChatBoxFocusLost(LLFocusableElement* caller, void* userdata)
+void LLFloaterIMNearbyChat::onChatBoxFocusLost()
{
// stop typing animation
gAgent.stopTyping();
diff --git a/indra/newview/llfloaterimnearbychat.h b/indra/newview/llfloaterimnearbychat.h
index a38824dc78..f4213eda5a 100644
--- a/indra/newview/llfloaterimnearbychat.h
+++ b/indra/newview/llfloaterimnearbychat.h
@@ -83,8 +83,8 @@ public:
protected:
static BOOL matchChatTypeTrigger(const std::string& in_str, std::string* out_str);
- static void onChatBoxKeystroke(LLTextEditor* caller, void* userdata);
- static void onChatBoxFocusLost(LLFocusableElement* caller, void* userdata);
+ void onChatBoxKeystroke();
+ void onChatBoxFocusLost();
void onChatBoxFocusReceived();
void sendChat( EChatType type );
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 1128b8fef6..37a3b9ac59 100644
--- a/indra/newview/skins/default/xui/en/floater_im_container.xml
+++ b/indra/newview/skins/default/xui/en/floater_im_container.xml
@@ -15,7 +15,7 @@
title="CONVERSATIONS"
bottom="-50"
right="-5"
- width="450">
+ width="500">
<string
name="collapse_icon"
value="Conv_toolbar_collapse"/>
@@ -24,22 +24,21 @@
value="Conv_toolbar_expand"/>
<layout_stack
animate="true"
+ bottom="-1"
follows="all"
- height="230"
layout="topleft"
left="0"
name="conversations_stack"
orientation="horizontal"
- top="0"
- width="450">
+ right="-1"
+ top="0">
<layout_panel
auto_resize="false"
user_resize="true"
- height="430"
name="conversations_layout_panel"
min_dim="38"
- width="268"
- expanded_min_dim="120">
+ width="225"
+ expanded_min_dim="200">
<layout_stack
animate="false"
follows="left|top|right"
@@ -48,8 +47,8 @@
left="0"
name="conversations_pane_buttons_stack"
orientation="horizontal"
- top="0"
- width="268">
+ right="-1"
+ top="0">
<layout_panel
auto_resize="true"
height="35"
@@ -123,32 +122,30 @@
top_pad="0"
left="5"
height="390"
- width="263"/>
+ right="-1"/>
</layout_panel>
<layout_panel
auto_resize="true"
user_resize="true"
- height="430"
name="messages_layout_panel"
- width="412"
expanded_min_dim="225">
<panel_container
+ bottom="-1"
follows="all"
- height="430"
layout="topleft"
left="0"
name="im_box_tab_container"
- top="0"
- width="412">
+ right="-1"
+ top="0">
<panel
+ bottom="-1"
follows="all"
layout="topleft"
name="stub_panel"
opaque="true"
top_pad="0"
left="0"
- height="430"
- width="412">
+ right="-1">
<button
follows="right|top"
height="25"