summaryrefslogtreecommitdiff
path: root/indra/newview/llimfloater.cpp
diff options
context:
space:
mode:
authorGilbert Gonzales <gilbert@lindenlab.com>2012-10-11 10:38:34 -0700
committerGilbert Gonzales <gilbert@lindenlab.com>2012-10-11 10:38:34 -0700
commit8aa424128ad06567f4c32c6672dc63d9b2111efa (patch)
tree6f9df2cba55345636ed3a0f3b914f23b8c3c4001 /indra/newview/llimfloater.cpp
parent046e90a8f74f3c13107a7edc72e912799a5e62e9 (diff)
CHUI-380: Before code review changes. Now the user selects a conversation or participant of a conversation the correct chat floater will appear. Focus will be redirected to the chat input text box automatically allowing the user to type into the input text box.
Diffstat (limited to 'indra/newview/llimfloater.cpp')
-rw-r--r--indra/newview/llimfloater.cpp37
1 files changed, 22 insertions, 15 deletions
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);
}
}