Set focus in all necessary ways, not just the keyboard alone, when tabs are changed by alt-arrows

This commit is contained in:
Melanie
2013-04-16 05:45:27 +02:00
parent 0b70e32f15
commit 158a434899
2 changed files with 22 additions and 4 deletions

View File

@@ -188,9 +188,14 @@ void LLFloaterChat::handleVisibilityChange(BOOL new_visibility)
void LLFloaterChat::onFocusReceived() void LLFloaterChat::onFocusReceived()
{ {
LLView* chat_editor = getChildView("Chat Editor"); LLView* chat_editor = getChildView("Chat Editor");
if (childIsVisible("Chat Editor")) if (getVisible() && childIsVisible("Chat Editor"))
{
gFocusMgr.setKeyboardFocus(chat_editor); gFocusMgr.setKeyboardFocus(chat_editor);
LLUICtrl * ctrl = static_cast<LLUICtrl*>(chat_editor);
ctrl->setFocus(TRUE);
}
LLFloater::onFocusReceived(); LLFloater::onFocusReceived();
} }
@@ -747,9 +752,13 @@ void LLFloaterChat::hide(LLFloater* instance, const LLSD& key)
BOOL LLFloaterChat::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash ) BOOL LLFloaterChat::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash )
{ {
LLView* chat_editor = getChildView("Chat Editor"); LLView* chat_editor = getChildView("Chat Editor");
if (childIsVisible("Chat Editor")) if (getVisible() && childIsVisible("Chat Editor"))
{ {
gFocusMgr.setKeyboardFocus(chat_editor); gFocusMgr.setKeyboardFocus(chat_editor);
LLUICtrl * ctrl = static_cast<LLUICtrl*>(chat_editor);
ctrl->setFocus(TRUE);
return TRUE; return TRUE;
} }

View File

@@ -2609,9 +2609,13 @@ const bool LLFloaterIMPanel::isModerator(const LLUUID& speaker_id)
BOOL LLFloaterIMPanel::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash ) BOOL LLFloaterIMPanel::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash )
{ {
LLView* chat_editor = getChildView("chat_editor"); LLView* chat_editor = getChildView("chat_editor");
if (childIsVisible("chat_editor")) if (getVisible() && childIsVisible("chat_editor"))
{ {
gFocusMgr.setKeyboardFocus(chat_editor); gFocusMgr.setKeyboardFocus(chat_editor);
LLUICtrl * ctrl = static_cast<LLUICtrl*>(chat_editor);
ctrl->setFocus(TRUE);
return TRUE; return TRUE;
} }
@@ -2621,8 +2625,13 @@ BOOL LLFloaterIMPanel::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash
void LLFloaterIMPanel::onFocusReceived() void LLFloaterIMPanel::onFocusReceived()
{ {
LLView* chat_editor = getChildView("chat_editor"); LLView* chat_editor = getChildView("chat_editor");
if (childIsVisible("chat_editor")) if (getVisible() && childIsVisible("chat_editor"))
{
gFocusMgr.setKeyboardFocus(chat_editor); gFocusMgr.setKeyboardFocus(chat_editor);
LLUICtrl * ctrl = static_cast<LLUICtrl*>(chat_editor);
ctrl->setFocus(TRUE);
}
LLFloater::onFocusReceived(); LLFloater::onFocusReceived();
} }