Hide default chatbar when user presses ESC while chatting and autohide is configured
parent
f8c5c37ae5
commit
814fe741ea
|
|
@ -120,18 +120,7 @@ void LLNearbyChatControl::onCommit()
|
|||
LLNearbyChat::instance().sendChat(getConvertedText(),CHAT_TYPE_NORMAL);
|
||||
setText(LLStringExplicit(""));
|
||||
|
||||
if(getName()=="default_chat_bar")
|
||||
{
|
||||
if(gSavedSettings.getBOOL("CloseChatOnReturn"))
|
||||
{
|
||||
setFocus(FALSE);
|
||||
}
|
||||
|
||||
if(gSavedSettings.getBOOL("AutohideChatBar"))
|
||||
{
|
||||
LLNearbyChat::instance().showDefaultChatBar(FALSE);
|
||||
}
|
||||
}
|
||||
autohide();
|
||||
|
||||
LLUICtrl::onCommit();
|
||||
}
|
||||
|
|
@ -246,3 +235,32 @@ void LLNearbyChatControl::setFocus(BOOL focus)
|
|||
LLNearbyChat::instance().setFocusedInputEditor(this,focus);
|
||||
LLLineEditor::setFocus(focus);
|
||||
}
|
||||
|
||||
void LLNearbyChatControl::autohide()
|
||||
{
|
||||
if(getName()=="default_chat_bar")
|
||||
{
|
||||
if(gSavedSettings.getBOOL("CloseChatOnReturn"))
|
||||
{
|
||||
setFocus(FALSE);
|
||||
}
|
||||
|
||||
if(gSavedSettings.getBOOL("AutohideChatBar"))
|
||||
{
|
||||
LLNearbyChat::instance().showDefaultChatBar(FALSE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// handle ESC key here
|
||||
BOOL LLNearbyChatControl::handleKeyHere(KEY key, MASK mask )
|
||||
{
|
||||
// autohide the chat bar if escape key was pressed and we're the default chat bar
|
||||
if(key==KEY_ESCAPE && mask==MASK_NONE)
|
||||
{
|
||||
autohide();
|
||||
gAgent.stopTyping();
|
||||
}
|
||||
|
||||
return LLLineEditor::handleKeyHere(key,mask);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ public:
|
|||
virtual void onFocusLost();
|
||||
virtual void setFocus(BOOL focus);
|
||||
|
||||
virtual BOOL handleKeyHere(KEY key,MASK mask);
|
||||
|
||||
static BOOL matchChatTypeTrigger(const std::string& in_str, std::string* out_str);
|
||||
|
||||
private:
|
||||
|
|
@ -50,6 +52,9 @@ private:
|
|||
|
||||
// Chat data entered to be sent to nearby chat
|
||||
void onCommit();
|
||||
|
||||
// Unfocus and autohide chat bar accordingly if we are the default chat bar
|
||||
void autohide();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Reference in New Issue