summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llconversationview.cpp28
-rwxr-xr-xindra/newview/llconversationview.h1
-rw-r--r--indra/newview/llimfloater.cpp37
-rw-r--r--indra/newview/llimfloater.h1
-rw-r--r--indra/newview/llnearbychat.cpp20
-rw-r--r--indra/newview/llnearbychat.h2
6 files changed, 70 insertions, 19 deletions
diff --git a/indra/newview/llconversationview.cpp b/indra/newview/llconversationview.cpp
index d4eb551f7a..112c38d8b8 100755
--- a/indra/newview/llconversationview.cpp
+++ b/indra/newview/llconversationview.cpp
@@ -32,6 +32,8 @@
#include <boost/bind.hpp>
#include "llagentdata.h"
#include "llconversationmodel.h"
+#include "llimfloater.h"
+#include "llnearbychat.h"
#include "llimconversation.h"
#include "llimfloatercontainer.h"
#include "llfloaterreg.h"
@@ -407,21 +409,41 @@ void LLConversationViewParticipant::draw()
static LLUIColor sMouseOverColor = LLUIColorTable::instance().getColor("InventoryMouseOverColor", DEFAULT_WHITE);
const BOOL show_context = (getRoot() ? getRoot()->getShowSelectionContext() : FALSE);
- const BOOL filled = show_context || (getRoot() ? getRoot()->getParentPanel()->hasFocus() : FALSE); // If we have keyboard focus, draw selection filled
const LLFontGL* font = getLabelFontForStyle(mLabelStyle);
F32 right_x = 0;
F32 y = (F32)getRect().getHeight() - font->getLineHeight() - (F32)mTextPad;
F32 text_left = (F32)getLabelXPos();
- LLColor4 color = (mIsSelected && filled) ? sHighlightFgColor : sFgColor;
+ LLColor4 color = mIsSelected ? sHighlightFgColor : sFgColor;
- drawHighlight(show_context, filled, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor);
+ drawHighlight(show_context, true, sHighlightBgColor, sFocusOutlineColor, sMouseOverColor);
drawLabel(font, text_left, y, color, right_x);
LLView::draw();
}
+void LLConversationViewParticipant::selectItem()
+{
+ LLConversationItem* vmi = this->getParentFolder() ? static_cast<LLConversationItem*>(this->getParentFolder()->getViewModelItem()) : NULL;
+
+ if(vmi)
+ {
+ //When null, show the nearby chat conversation floater
+ if(vmi->getUUID().isNull())
+ {
+ LLNearbyChat* nearbyChat = LLFloaterReg::findTypedInstance<LLNearbyChat>("nearby_chat");
+ nearbyChat->show();
+ }
+ //Otherwise, show the IM conversation floater
+ else
+ {
+ LLIMFloater::show(vmi->getUUID());
+ }
+ }
+
+ LLFolderViewItem::selectItem();
+}
void LLConversationViewParticipant::refresh()
{
diff --git a/indra/newview/llconversationview.h b/indra/newview/llconversationview.h
index c81c70b456..bd95387bbe 100755
--- a/indra/newview/llconversationview.h
+++ b/indra/newview/llconversationview.h
@@ -113,6 +113,7 @@ public:
};
virtual ~LLConversationViewParticipant( void ) { }
+ void selectItem();
bool hasSameValue(const LLUUID& uuid) { return (uuid == mUUID); }
virtual void refresh();
void addToFolder(LLFolderViewFolder* folder);
diff --git a/indra/newview/llimfloater.cpp b/indra/newview/llimfloater.cpp
index 99337bd5f3..990b9c45f9 100644
--- a/indra/newview/llimfloater.cpp
+++ b/indra/newview/llimfloater.cpp
@@ -719,6 +719,27 @@ void LLIMFloater::setDocked(bool docked, bool pop_on_undock)
}
}
+void LLIMFloater::setFocus(BOOL focusFlag)
+{
+ LLTransientDockableFloater::setFocus(focusFlag);
+
+ BOOL is_minimized = focusFlag && isChatMultiTab()
+ ? LLIMFloaterContainer::getInstance()->isMinimized()
+ : !focusFlag;
+
+ //Redirect focus to input editor
+ if (!is_minimized && mChatHistory && mInputEditor)
+ {
+ //only if floater was construced and initialized from xml
+ updateMessages();
+ //prevent stealing focus when opening a background IM tab (EXT-5387, checking focus for EXT-6781)
+ if (!isChatMultiTab() || hasFocus())
+ {
+ mInputEditor->setFocus(TRUE);
+ }
+ }
+}
+
void LLIMFloater::setVisible(BOOL visible)
{
LLNotificationsUI::LLScreenChannel* channel = static_cast<LLNotificationsUI::LLScreenChannel*>
@@ -734,21 +755,6 @@ void LLIMFloater::setVisible(BOOL visible)
channel->redrawToasts();
}
- BOOL is_minimized = visible && isChatMultiTab()
- ? LLIMFloaterContainer::getInstance()->isMinimized()
- : !visible;
-
- if (!is_minimized && mChatHistory && mInputEditor)
- {
- //only if floater was construced and initialized from xml
- updateMessages();
- //prevent stealing focus when opening a background IM tab (EXT-5387, checking focus for EXT-6781)
- if (!isChatMultiTab() || hasFocus())
- {
- mInputEditor->setFocus(TRUE);
- }
- }
-
if(!visible)
{
LLIMChiclet* chiclet = LLChicletBar::getInstance()->getChicletPanel()->findChiclet<LLIMChiclet>(mSessionID);
@@ -761,6 +767,7 @@ void LLIMFloater::setVisible(BOOL visible)
if (visible && isInVisibleChain())
{
sIMFloaterShowedSignal(mSessionID);
+ setFocus(TRUE);
}
}
diff --git a/indra/newview/llimfloater.h b/indra/newview/llimfloater.h
index 5ed1d1ab35..26daf00afd 100644
--- a/indra/newview/llimfloater.h
+++ b/indra/newview/llimfloater.h
@@ -65,6 +65,7 @@ public:
// LLView overrides
/*virtual*/ BOOL postBuild();
+ /*virtual*/ void setFocus(BOOL focusFlag);
/*virtual*/ void setVisible(BOOL visible);
/*virtual*/ BOOL getVisible();
// Check typing timeout timer.
diff --git a/indra/newview/llnearbychat.cpp b/indra/newview/llnearbychat.cpp
index b96b486868..e0778afd86 100644
--- a/indra/newview/llnearbychat.cpp
+++ b/indra/newview/llnearbychat.cpp
@@ -271,11 +271,31 @@ void LLNearbyChat::removeScreenChat()
}
}
+void LLNearbyChat::setFocus(BOOL focusFlag)
+{
+ LLTransientDockableFloater::setFocus(focusFlag);
+
+ BOOL is_minimized = focusFlag && isChatMultiTab()
+ ? LLIMFloaterContainer::getInstance()->isMinimized()
+ : !focusFlag;
+
+ //Redirect focus to input editor
+ if (!is_minimized && mChatHistory && mInputEditor)
+ {
+ //prevent stealing focus when opening a background IM tab (EXT-5387, checking focus for EXT-6781)
+ if (!isChatMultiTab() || hasFocus())
+ {
+ mInputEditor->setFocus(TRUE);
+ }
+ }
+}
+
void LLNearbyChat::setVisible(BOOL visible)
{
if(visible)
{
removeScreenChat();
+ setFocus(TRUE);
}
LLIMConversation::setVisible(visible);
diff --git a/indra/newview/llnearbychat.h b/indra/newview/llnearbychat.h
index 93168ba96a..7ada4daea8 100644
--- a/indra/newview/llnearbychat.h
+++ b/indra/newview/llnearbychat.h
@@ -52,7 +52,7 @@ public:
/*virtual*/ BOOL postBuild();
/*virtual*/ void onOpen(const LLSD& key);
-
+ /*virtual*/ void setFocus(BOOL focusFlag);
/*virtual*/ void setVisible(BOOL visible);
void loadHistory();