summaryrefslogtreecommitdiff
path: root/indra/llui
diff options
context:
space:
mode:
authorCallum Prentice <callum@lindenlab.com>2014-07-21 13:26:48 -0700
committerCallum Prentice <callum@lindenlab.com>2014-07-21 13:26:48 -0700
commitc25105945a9d74e331cae4d827fc3be8d8915b7a (patch)
tree894c4f663fecc5659e2e1afbe7a815fd0b921f4f /indra/llui
parentf5c7d69317af103b5f5f762d7e0adb82f12a71b3 (diff)
parent532433674c9553636af9ea8d433b9da6d6fae587 (diff)
Merge with head of viewer-release
Diffstat (limited to 'indra/llui')
-rwxr-xr-xindra/llui/llchatentry.cpp10
-rwxr-xr-xindra/llui/llfolderview.cpp22
-rwxr-xr-xindra/llui/lltexteditor.cpp5
-rwxr-xr-xindra/llui/lltexteditor.h2
4 files changed, 16 insertions, 23 deletions
diff --git a/indra/llui/llchatentry.cpp b/indra/llui/llchatentry.cpp
index c04b70eb64..dac001afab 100755
--- a/indra/llui/llchatentry.cpp
+++ b/indra/llui/llchatentry.cpp
@@ -51,6 +51,7 @@ LLChatEntry::LLChatEntry(const Params& p)
mCurrentHistoryLine = mLineHistory.begin();
mAutoIndent = false;
+ keepSelectionOnReturn(true);
}
LLChatEntry::~LLChatEntry()
@@ -179,15 +180,6 @@ BOOL LLChatEntry::handleSpecialKey(const KEY key, const MASK mask)
{
BOOL handled = FALSE;
- // In the case of a chat entry, pressing RETURN when something is selected
- // should NOT erase the selection (unlike a notecard, for example)
- if (key == KEY_RETURN)
- {
- endOfDoc();
- startSelection();
- endSelection();
- }
-
LLTextEditor::handleSpecialKey(key, mask);
switch(key)
diff --git a/indra/llui/llfolderview.cpp b/indra/llui/llfolderview.cpp
index bc2388dd28..cca26f335a 100755
--- a/indra/llui/llfolderview.cpp
+++ b/indra/llui/llfolderview.cpp
@@ -1130,18 +1130,18 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
if((mSelectedItems.size() > 0) && mScrollContainer)
{
LLFolderViewItem* last_selected = getCurSelectedItem();
+ BOOL shift_select = mask & MASK_SHIFT;
+ // don't shift select down to children of folders (they are implicitly selected through parent)
+ LLFolderViewItem* next = last_selected->getNextOpenNode(!shift_select);
- if (!mKeyboardSelection)
+ if (!mKeyboardSelection || (!shift_select && (!next || next == last_selected)))
{
setSelection(last_selected, FALSE, TRUE);
mKeyboardSelection = TRUE;
}
- LLFolderViewItem* next = NULL;
- if (mask & MASK_SHIFT)
+ if (shift_select)
{
- // don't shift select down to children of folders (they are implicitly selected through parent)
- next = last_selected->getNextOpenNode(FALSE);
if (next)
{
if (next->isSelected())
@@ -1158,7 +1158,6 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
}
else
{
- next = last_selected->getNextOpenNode();
if( next )
{
if (next == last_selected)
@@ -1194,18 +1193,18 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
if((mSelectedItems.size() > 0) && mScrollContainer)
{
LLFolderViewItem* last_selected = mSelectedItems.back();
+ BOOL shift_select = mask & MASK_SHIFT;
+ // don't shift select down to children of folders (they are implicitly selected through parent)
+ LLFolderViewItem* prev = last_selected->getPreviousOpenNode(!shift_select);
- if (!mKeyboardSelection)
+ if (!mKeyboardSelection || (!shift_select && prev == this))
{
setSelection(last_selected, FALSE, TRUE);
mKeyboardSelection = TRUE;
}
- LLFolderViewItem* prev = NULL;
- if (mask & MASK_SHIFT)
+ if (shift_select)
{
- // don't shift select down to children of folders (they are implicitly selected through parent)
- prev = last_selected->getPreviousOpenNode(FALSE);
if (prev)
{
if (prev->isSelected())
@@ -1222,7 +1221,6 @@ BOOL LLFolderView::handleKeyHere( KEY key, MASK mask )
}
else
{
- prev = last_selected->getPreviousOpenNode();
if( prev )
{
if (prev == this)
diff --git a/indra/llui/lltexteditor.cpp b/indra/llui/lltexteditor.cpp
index 90e3606998..576e8f7600 100755
--- a/indra/llui/lltexteditor.cpp
+++ b/indra/llui/lltexteditor.cpp
@@ -260,7 +260,8 @@ LLTextEditor::LLTextEditor(const LLTextEditor::Params& p) :
mContextMenu(NULL),
mShowContextMenu(p.show_context_menu),
mEnableTooltipPaste(p.enable_tooltip_paste),
- mPassDelete(FALSE)
+ mPassDelete(FALSE),
+ mKeepSelectionOnReturn(false)
{
mSourceID.generate();
@@ -1653,7 +1654,7 @@ BOOL LLTextEditor::handleSpecialKey(const KEY key, const MASK mask)
case KEY_RETURN:
if (mask == MASK_NONE)
{
- if( hasSelection() )
+ if( hasSelection() && !mKeepSelectionOnReturn )
{
deleteSelection(FALSE);
}
diff --git a/indra/llui/lltexteditor.h b/indra/llui/lltexteditor.h
index 2408613824..f6bdf917b4 100755
--- a/indra/llui/lltexteditor.h
+++ b/indra/llui/lltexteditor.h
@@ -282,6 +282,7 @@ protected:
bool mParseOnTheFly;
void updateLinkSegments();
+ void keepSelectionOnReturn(bool keep) { mKeepSelectionOnReturn = keep; }
class LLViewBorder* mBorder;
private:
@@ -316,6 +317,7 @@ private:
bool mShowContextMenu;
bool mEnableTooltipPaste;
bool mPassDelete;
+ bool mKeepSelectionOnReturn; // disabling of removing selected text after pressing of Enter
LLUUID mSourceID;