Fix chat focus issues once and for all
This commit is contained in:
@@ -112,7 +112,7 @@ public:
|
|||||||
|
|
||||||
BOOL focusNextItem(BOOL text_entry_only);
|
BOOL focusNextItem(BOOL text_entry_only);
|
||||||
BOOL focusPrevItem(BOOL text_entry_only);
|
BOOL focusPrevItem(BOOL text_entry_only);
|
||||||
BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE );
|
virtual BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE );
|
||||||
BOOL focusLastItem(BOOL prefer_text_fields = FALSE);
|
BOOL focusLastItem(BOOL prefer_text_fields = FALSE);
|
||||||
|
|
||||||
// Non Virtuals
|
// Non Virtuals
|
||||||
|
|||||||
@@ -187,7 +187,10 @@ void LLFloaterChat::handleVisibilityChange(BOOL new_visibility)
|
|||||||
// virtual
|
// virtual
|
||||||
void LLFloaterChat::onFocusReceived()
|
void LLFloaterChat::onFocusReceived()
|
||||||
{
|
{
|
||||||
gFocusMgr.setKeyboardFocus(getChildView("Chat Editor")); // Work around the chat bar no longer focusing from within the layout_stack
|
LLView* chat_editor = getChildView("Chat Editor");
|
||||||
|
if (childIsVisible("Chat Editor"))
|
||||||
|
gFocusMgr.setKeyboardFocus(chat_editor);
|
||||||
|
|
||||||
LLFloater::onFocusReceived();
|
LLFloater::onFocusReceived();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -740,3 +743,16 @@ void LLFloaterChat::hide(LLFloater* instance, const LLSD& key)
|
|||||||
VisibilityPolicy<LLFloater>::hide(instance, key);
|
VisibilityPolicy<LLFloater>::hide(instance, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL LLFloaterChat::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash )
|
||||||
|
{
|
||||||
|
LLView* chat_editor = getChildView("Chat Editor");
|
||||||
|
if (childIsVisible("Chat Editor"))
|
||||||
|
{
|
||||||
|
gFocusMgr.setKeyboardFocus(chat_editor);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return LLUICtrl::focusFirstItem(prefer_text_fields, focus_flash);
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -98,6 +98,8 @@ public:
|
|||||||
LLPanelActiveSpeakers* mPanel;
|
LLPanelActiveSpeakers* mPanel;
|
||||||
BOOL mScrolledToEnd;
|
BOOL mScrolledToEnd;
|
||||||
|
|
||||||
|
BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE );
|
||||||
|
|
||||||
CachedUICtrl<LLButton> mToggleActiveSpeakersBtn;
|
CachedUICtrl<LLButton> mToggleActiveSpeakersBtn;
|
||||||
CachedUICtrl<LLChatBar> mChatPanel;
|
CachedUICtrl<LLChatBar> mChatPanel;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2606,3 +2606,23 @@ const bool LLFloaterIMPanel::isModerator(const LLUUID& speaker_id)
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL LLFloaterIMPanel::focusFirstItem(BOOL prefer_text_fields, BOOL focus_flash )
|
||||||
|
{
|
||||||
|
LLView* chat_editor = getChildView("chat_editor");
|
||||||
|
if (childIsVisible("chat_editor"))
|
||||||
|
{
|
||||||
|
gFocusMgr.setKeyboardFocus(chat_editor);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return LLUICtrl::focusFirstItem(prefer_text_fields, focus_flash);
|
||||||
|
}
|
||||||
|
|
||||||
|
void LLFloaterIMPanel::onFocusReceived()
|
||||||
|
{
|
||||||
|
LLView* chat_editor = getChildView("chat_editor");
|
||||||
|
if (childIsVisible("chat_editor"))
|
||||||
|
gFocusMgr.setKeyboardFocus(chat_editor);
|
||||||
|
|
||||||
|
LLFloater::onFocusReceived();
|
||||||
|
}
|
||||||
|
|||||||
@@ -231,6 +231,9 @@ public:
|
|||||||
void *cargo_data, EAcceptance *accept,
|
void *cargo_data, EAcceptance *accept,
|
||||||
std::string& tooltip_msg);
|
std::string& tooltip_msg);
|
||||||
|
|
||||||
|
BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE );
|
||||||
|
|
||||||
|
void onFocusReceived();
|
||||||
void onInputEditorFocusReceived();
|
void onInputEditorFocusReceived();
|
||||||
void onInputEditorFocusLost();
|
void onInputEditorFocusLost();
|
||||||
static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata);
|
static void onInputEditorKeystroke(LLLineEditor* caller, void* userdata);
|
||||||
|
|||||||
Reference in New Issue
Block a user