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:
@@ -779,6 +779,17 @@
|
|||||||
<key>Value</key>
|
<key>Value</key>
|
||||||
<integer>1</integer>
|
<integer>1</integer>
|
||||||
</map>
|
</map>
|
||||||
|
<key>LiruLegacyScrollToEnd</key>
|
||||||
|
<map>
|
||||||
|
<key>Comment</key>
|
||||||
|
<string>Automatically scroll to the end of a chat's history when the chat regains focus.</string>
|
||||||
|
<key>Persist</key>
|
||||||
|
<integer>1</integer>
|
||||||
|
<key>Type</key>
|
||||||
|
<string>Boolean</string>
|
||||||
|
<key>Value</key>
|
||||||
|
<integer>0</integer>
|
||||||
|
</map>
|
||||||
<key>LiruLocalTime</key>
|
<key>LiruLocalTime</key>
|
||||||
<map>
|
<map>
|
||||||
<key>Comment</key>
|
<key>Comment</key>
|
||||||
|
|||||||
@@ -262,6 +262,7 @@ void LLPrefsAscentChat::refreshValues()
|
|||||||
mOneLineGroupButt = gSavedSettings.getBOOL("UseConciseGroupChatButtons");
|
mOneLineGroupButt = gSavedSettings.getBOOL("UseConciseGroupChatButtons");
|
||||||
mOneLineConfButt = gSavedSettings.getBOOL("UseConciseConferenceButtons");
|
mOneLineConfButt = gSavedSettings.getBOOL("UseConciseConferenceButtons");
|
||||||
mOnlyComm = gSavedSettings.getBOOL("CommunicateSpecificShortcut");
|
mOnlyComm = gSavedSettings.getBOOL("CommunicateSpecificShortcut");
|
||||||
|
mLegacyEndScroll = gSavedSettings.getBOOL("LiruLegacyScrollToEnd");
|
||||||
mItalicizeActions = gSavedSettings.getBOOL("LiruItalicizeActions");
|
mItalicizeActions = gSavedSettings.getBOOL("LiruItalicizeActions");
|
||||||
mLegacyLogLaunch = gSavedSettings.getBOOL("LiruLegacyLogLaunch");
|
mLegacyLogLaunch = gSavedSettings.getBOOL("LiruLegacyLogLaunch");
|
||||||
mFriendNames = gSavedSettings.getS32("FriendNameSystem");
|
mFriendNames = gSavedSettings.getS32("FriendNameSystem");
|
||||||
@@ -497,6 +498,7 @@ void LLPrefsAscentChat::cancel()
|
|||||||
gSavedSettings.setBOOL("UseConciseGroupChatButtons", mOneLineGroupButt);
|
gSavedSettings.setBOOL("UseConciseGroupChatButtons", mOneLineGroupButt);
|
||||||
gSavedSettings.setBOOL("UseConciseConferenceButtons", mOneLineConfButt);
|
gSavedSettings.setBOOL("UseConciseConferenceButtons", mOneLineConfButt);
|
||||||
gSavedSettings.setBOOL("CommunicateSpecificShortcut", mOnlyComm);
|
gSavedSettings.setBOOL("CommunicateSpecificShortcut", mOnlyComm);
|
||||||
|
gSavedSettings.setBOOL("LiruLegacyScrollToEnd", mLegacyEndScroll);
|
||||||
gSavedSettings.setBOOL("LiruItalicizeActions", mItalicizeActions);
|
gSavedSettings.setBOOL("LiruItalicizeActions", mItalicizeActions);
|
||||||
gSavedSettings.setBOOL("LiruLegacyLogLaunch", mLegacyLogLaunch);
|
gSavedSettings.setBOOL("LiruLegacyLogLaunch", mLegacyLogLaunch);
|
||||||
gSavedSettings.setS32("FriendNameSystem", mFriendNames);
|
gSavedSettings.setS32("FriendNameSystem", mFriendNames);
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ private:
|
|||||||
bool mOneLineGroupButt;
|
bool mOneLineGroupButt;
|
||||||
bool mOneLineConfButt;
|
bool mOneLineConfButt;
|
||||||
bool mOnlyComm;
|
bool mOnlyComm;
|
||||||
|
bool mLegacyEndScroll;
|
||||||
bool mItalicizeActions;
|
bool mItalicizeActions;
|
||||||
bool mLegacyLogLaunch;
|
bool mLegacyLogLaunch;
|
||||||
S32 mFriendNames;
|
S32 mFriendNames;
|
||||||
|
|||||||
@@ -153,6 +153,7 @@ BOOL LLChatBar::postBuild()
|
|||||||
mInputEditor->setAutoreplaceCallback(boost::bind(&LLAutoReplace::autoreplaceCallback, LLAutoReplace::getInstance(), _1, _2, _3, _4, _5));
|
mInputEditor->setAutoreplaceCallback(boost::bind(&LLAutoReplace::autoreplaceCallback, LLAutoReplace::getInstance(), _1, _2, _3, _4, _5));
|
||||||
mInputEditor->setKeystrokeCallback(boost::bind(&LLChatBar::onInputEditorKeystroke,this));
|
mInputEditor->setKeystrokeCallback(boost::bind(&LLChatBar::onInputEditorKeystroke,this));
|
||||||
mInputEditor->setFocusLostCallback(boost::bind(&LLChatBar::onInputEditorFocusLost));
|
mInputEditor->setFocusLostCallback(boost::bind(&LLChatBar::onInputEditorFocusLost));
|
||||||
|
mInputEditor->setFocusReceivedCallback(boost::bind(&LLChatBar::onInputEditorGainFocus));
|
||||||
mInputEditor->setCommitOnFocusLost( FALSE );
|
mInputEditor->setCommitOnFocusLost( FALSE );
|
||||||
mInputEditor->setRevertOnEsc( FALSE );
|
mInputEditor->setRevertOnEsc( FALSE );
|
||||||
mInputEditor->setIgnoreTab(TRUE);
|
mInputEditor->setIgnoreTab(TRUE);
|
||||||
@@ -636,6 +637,13 @@ void LLChatBar::onInputEditorFocusLost()
|
|||||||
gAgent.stopTyping();
|
gAgent.stopTyping();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
void LLChatBar::onInputEditorGainFocus()
|
||||||
|
{
|
||||||
|
if (gSavedSettings.getBOOL("LiruLegacyScrollToEnd"))
|
||||||
|
LLFloaterChat::setHistoryCursorAndScrollToEnd();
|
||||||
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
void LLChatBar::onClickSay( LLUICtrl* ctrl )
|
void LLChatBar::onClickSay( LLUICtrl* ctrl )
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ public:
|
|||||||
|
|
||||||
void onInputEditorKeystroke();
|
void onInputEditorKeystroke();
|
||||||
static void onInputEditorFocusLost();
|
static void onInputEditorFocusLost();
|
||||||
|
static void onInputEditorGainFocus();
|
||||||
|
|
||||||
void onCommitGesture(LLUICtrl* ctrl);
|
void onCommitGesture(LLUICtrl* ctrl);
|
||||||
|
|
||||||
|
|||||||
@@ -333,6 +333,20 @@ void LLFloaterChat::addChatHistory(const LLChat& chat, bool log_to_file)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// static
|
||||||
|
void LLFloaterChat::setHistoryCursorAndScrollToEnd()
|
||||||
|
{
|
||||||
|
if (LLViewerTextEditor* editor = getInstance()->findChild<LLViewerTextEditor>("Chat History Editor"))
|
||||||
|
{
|
||||||
|
editor->setCursorAndScrollToEnd();
|
||||||
|
}
|
||||||
|
if (LLViewerTextEditor* editor = getInstance()->findChild<LLViewerTextEditor>("Chat History Editor with mute"))
|
||||||
|
{
|
||||||
|
editor->setCursorAndScrollToEnd();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//static
|
//static
|
||||||
void LLFloaterChat::onClickMute(void *data)
|
void LLFloaterChat::onClickMute(void *data)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -69,6 +69,8 @@ public:
|
|||||||
void updateConsoleVisibility();
|
void updateConsoleVisibility();
|
||||||
void updateSettings();
|
void updateSettings();
|
||||||
|
|
||||||
|
static void setHistoryCursorAndScrollToEnd();
|
||||||
|
|
||||||
// Add chat to console and history list.
|
// Add chat to console and history list.
|
||||||
// Color based on source, type, distance.
|
// Color based on source, type, distance.
|
||||||
static void addChat(const LLChat& chat, BOOL from_im = FALSE, BOOL local_agent = FALSE);
|
static void addChat(const LLChat& chat, BOOL from_im = FALSE, BOOL local_agent = FALSE);
|
||||||
|
|||||||
@@ -468,6 +468,7 @@ BOOL LLFloaterIMPanel::postBuild()
|
|||||||
|
|
||||||
mInputEditor = getChild<LLLineEditor>("chat_editor");
|
mInputEditor = getChild<LLLineEditor>("chat_editor");
|
||||||
mInputEditor->setAutoreplaceCallback(boost::bind(&LLAutoReplace::autoreplaceCallback, LLAutoReplace::getInstance(), _1, _2, _3, _4, _5));
|
mInputEditor->setAutoreplaceCallback(boost::bind(&LLAutoReplace::autoreplaceCallback, LLAutoReplace::getInstance(), _1, _2, _3, _4, _5));
|
||||||
|
mInputEditor->setFocusReceivedCallback( boost::bind(&LLFloaterIMPanel::onInputEditorFocusReceived, this) );
|
||||||
mFocusLostSignal = mInputEditor->setFocusLostCallback(boost::bind(&LLFloaterIMPanel::setTyping, this, false));
|
mFocusLostSignal = mInputEditor->setFocusLostCallback(boost::bind(&LLFloaterIMPanel::setTyping, this, false));
|
||||||
mInputEditor->setKeystrokeCallback( boost::bind(&LLFloaterIMPanel::onInputEditorKeystroke, this, _1) );
|
mInputEditor->setKeystrokeCallback( boost::bind(&LLFloaterIMPanel::onInputEditorKeystroke, this, _1) );
|
||||||
mInputEditor->setCommitCallback( boost::bind(&LLFloaterIMPanel::onSendMsg,this) );
|
mInputEditor->setCommitCallback( boost::bind(&LLFloaterIMPanel::onSendMsg,this) );
|
||||||
@@ -1027,6 +1028,12 @@ void LLFloaterIMPanel::onClickToggleActiveSpeakers(const LLSD& value)
|
|||||||
childSetVisible("active_speakers_panel", !value);
|
childSetVisible("active_speakers_panel", !value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void LLFloaterIMPanel::onInputEditorFocusReceived()
|
||||||
|
{
|
||||||
|
if (gSavedSettings.getBOOL("LiruLegacyScrollToEnd"))
|
||||||
|
mHistoryEditor->setCursorAndScrollToEnd();
|
||||||
|
}
|
||||||
|
|
||||||
void LLFloaterIMPanel::onInputEditorKeystroke(LLLineEditor* caller)
|
void LLFloaterIMPanel::onInputEditorKeystroke(LLLineEditor* caller)
|
||||||
{
|
{
|
||||||
// Deleting all text counts as stopping typing.
|
// Deleting all text counts as stopping typing.
|
||||||
|
|||||||
@@ -97,6 +97,7 @@ public:
|
|||||||
BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE );
|
BOOL focusFirstItem(BOOL prefer_text_fields = FALSE, BOOL focus_flash = TRUE );
|
||||||
|
|
||||||
void onFocusReceived();
|
void onFocusReceived();
|
||||||
|
void onInputEditorFocusReceived();
|
||||||
void onInputEditorKeystroke(LLLineEditor* caller);
|
void onInputEditorKeystroke(LLLineEditor* caller);
|
||||||
|
|
||||||
void onClickHistory();
|
void onClickHistory();
|
||||||
|
|||||||
@@ -96,6 +96,7 @@
|
|||||||
<check_box bottom_delta="-20" control_name="UseConciseConferenceButtons" follows="top" height="16" label="Buttons on conference title line (Affects new conferences)" name="conf_concise_butt"/>
|
<check_box bottom_delta="-20" control_name="UseConciseConferenceButtons" follows="top" height="16" label="Buttons on conference title line (Affects new conferences)" name="conf_concise_butt"/>
|
||||||
<check_box bottom_delta="-20" follows="top" height="16" control_name="LiruLegacyLogLaunch" label="Log button opens external text editor (Windows and Mac only)" name="legacy_log_launch"/>
|
<check_box bottom_delta="-20" follows="top" height="16" control_name="LiruLegacyLogLaunch" label="Log button opens external text editor (Windows and Mac only)" name="legacy_log_launch"/>
|
||||||
<check_box bottom_delta="-20" follows="top" height="16" initial_value="false" label="Disallow communicate shortcut opening detached friends list" control_name="CommunicateSpecificShortcut" name="only_comm"/>
|
<check_box bottom_delta="-20" follows="top" height="16" initial_value="false" label="Disallow communicate shortcut opening detached friends list" control_name="CommunicateSpecificShortcut" name="only_comm"/>
|
||||||
|
<check_box bottom_delta="-20" follows="top" control_name="LiruLegacyScrollToEnd" label="Autoscroll to the end of chats when they regain focus" name="scroll_to_end_on_focus"/>
|
||||||
<check_box bottom_delta="-20" follows="top" height="16" control_name="LiruItalicizeActions" label="Italicize action messages (/me)" name="italicize_actions"/>
|
<check_box bottom_delta="-20" follows="top" height="16" control_name="LiruItalicizeActions" label="Italicize action messages (/me)" name="italicize_actions"/>
|
||||||
</panel>
|
</panel>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user