Introduce a setting for Automatically scrolling to the bottom of a chat when the chat gains focus

Preferences->Adv. Chat->Chat UI, Autoscroll to the end of chats when they regain focus.
This defaults to false, unlike the legacy behavior.

Partial revert of "Feature Removal!: Do not scroll to the end of chats when the corresponding chatbar regains focus!"
This commit is contained in:
Inusaito Sayori
2014-05-22 19:46:15 -04:00
parent 852a8407c8
commit dadbb00b85
10 changed files with 48 additions and 0 deletions

View File

@@ -153,6 +153,7 @@ BOOL LLChatBar::postBuild()
mInputEditor->setAutoreplaceCallback(boost::bind(&LLAutoReplace::autoreplaceCallback, LLAutoReplace::getInstance(), _1, _2, _3, _4, _5));
mInputEditor->setKeystrokeCallback(boost::bind(&LLChatBar::onInputEditorKeystroke,this));
mInputEditor->setFocusLostCallback(boost::bind(&LLChatBar::onInputEditorFocusLost));
mInputEditor->setFocusReceivedCallback(boost::bind(&LLChatBar::onInputEditorGainFocus));
mInputEditor->setCommitOnFocusLost( FALSE );
mInputEditor->setRevertOnEsc( FALSE );
mInputEditor->setIgnoreTab(TRUE);
@@ -636,6 +637,13 @@ void LLChatBar::onInputEditorFocusLost()
gAgent.stopTyping();
}
// static
void LLChatBar::onInputEditorGainFocus()
{
if (gSavedSettings.getBOOL("LiruLegacyScrollToEnd"))
LLFloaterChat::setHistoryCursorAndScrollToEnd();
}
// static
void LLChatBar::onClickSay( LLUICtrl* ctrl )
{