summaryrefslogtreecommitdiff
path: root/indra/newview/llconversationview.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2012-11-08 13:34:57 -0800
committerMerov Linden <merov@lindenlab.com>2012-11-08 13:34:57 -0800
commit865cb1b9674cf61d1abda6865e568fe5d791edcd (patch)
tree78f0ce12b6496e02fee29f0927cf472b4ca757d7 /indra/newview/llconversationview.cpp
parent4ee2b01b304b5c95fd4b1d73109033d37e84cb25 (diff)
parent93f9c6991819f53ea03b36dff1af77bbd74ff43b (diff)
Pull merge from viewer-chui
Diffstat (limited to 'indra/newview/llconversationview.cpp')
-rwxr-xr-xindra/newview/llconversationview.cpp77
1 files changed, 28 insertions, 49 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index c6b970158f..ac5b2ad6ac 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -203,6 +203,17 @@ void LLConversationViewSession::draw()
LLView::draw();
}
+BOOL LLConversationViewSession::handleMouseDown( S32 x, S32 y, MASK mask )
+{
+ LLConversationItem* item = dynamic_cast<LLConversationItem *>(getViewModelItem());
+ LLUUID session_id = item? item->getUUID() : LLUUID();
+
+ (LLFloaterReg::getTypedInstance<LLIMFloaterContainer>("im_container"))->
+ selectConversationPair(session_id, false);
+
+ return LLFolderViewFolder::handleMouseDown(x, y, mask);
+}
+
// virtual
S32 LLConversationViewSession::arrange(S32* width, S32* height)
{
@@ -233,30 +244,6 @@ void LLConversationViewSession::toggleOpen()
}
}
-void LLConversationViewSession::selectItem()
-{
- LLFolderViewModelItem* item = mViewModelItem;
- LLUUID session_uuid = dynamic_cast<LLConversationItem*>(item)->getUUID();
- LLFloater* session_floater = LLIMConversation::getConversation(session_uuid);
- LLMultiFloater* host_floater = session_floater->getHost();
-
- if (host_floater == mContainer)
- {
- // Always expand the message pane if the panel is hosted by the container
- mContainer->collapseMessagesPane(false);
- // Switch to the conversation floater that is being selected
- mContainer->selectFloater(session_floater);
- }
-
- // Set the focus on the selected floater
- session_floater->setFocus(TRUE);
- // Store the active session
- LLIMFloaterContainer::getInstance()->setSelectedSession(session_uuid);
-
-
- LLFolderViewItem::selectItem();
-}
-
void LLConversationViewSession::toggleMinimizedMode(bool is_minimized)
{
mMinimizedMode = is_minimized;
@@ -458,31 +445,6 @@ S32 LLConversationViewParticipant::arrange(S32* width, S32* height)
return arranged;
}
-void LLConversationViewParticipant::selectItem()
-{
- LLConversationItem* vmi = this->getParentFolder() ? static_cast<LLConversationItem*>(this->getParentFolder()->getViewModelItem()) : NULL;
- LLIMFloaterContainer* container = LLIMFloaterContainer::getInstance();
- LLFloater* session_floater;
-
- if(vmi)
- {
- session_floater = LLIMConversation::getConversation(vmi->getUUID());
-
- //Only execute when switching floaters (conversations)
- if(vmi->getUUID() != container->getSelectedSession())
- {
- container->selectFloater(session_floater);
- // Store the active session
- container->setSelectedSession(vmi->getUUID());
- }
-
- //Redirect focus to the conversation floater
- session_floater->setFocus(TRUE);
- }
-
- LLFolderViewItem::selectItem();
-}
-
void LLConversationViewParticipant::refresh()
{
// Refresh the participant view from its model data
@@ -532,6 +494,23 @@ void LLConversationViewParticipant::onMouseLeave(S32 x, S32 y, MASK mask)
LLFolderViewItem::onMouseLeave(x, y, mask);
}
+BOOL LLConversationViewParticipant::handleMouseDown( S32 x, S32 y, MASK mask )
+{
+ LLConversationItem* item = NULL;
+ LLConversationViewSession* session_widget =
+ dynamic_cast<LLConversationViewSession *>(this->getParentFolder());
+ if (session_widget)
+ {
+ item = dynamic_cast<LLConversationItem*>(session_widget->getViewModelItem());
+ }
+ LLUUID session_id = item? item->getUUID() : LLUUID();
+
+ (LLFloaterReg::getTypedInstance<LLIMFloaterContainer>("im_container"))->
+ selectConversationPair(session_id, false);
+
+ return LLFolderViewItem::handleMouseDown(x, y, mask);
+}
+
S32 LLConversationViewParticipant::getLabelXPos()
{
return getIndentation() + mAvatarIcon->getRect().getWidth() + mIconPad;