diff options
Diffstat (limited to 'indra/llui')
-rwxr-xr-x | indra/llui/llchatentry.cpp | 10 | ||||
-rwxr-xr-x | indra/llui/llfolderview.cpp | 22 | ||||
-rwxr-xr-x | indra/llui/lltexteditor.cpp | 5 | ||||
-rwxr-xr-x | indra/llui/lltexteditor.h | 2 | ||||
-rwxr-xr-x | indra/llui/lltooltip.cpp | 3 |
5 files changed, 18 insertions, 24 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; diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 5e1f12996e..7f2224870d 100755 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -477,7 +477,8 @@ void LLToolTipMgr::show(const std::string& msg) void LLToolTipMgr::show(const LLToolTip::Params& params) { if (!params.styled_message.isProvided() - && (!params.message.isProvided() || params.message().empty())) return; + && (!params.message.isProvided() || params.message().empty()) + && !params.image.isProvided()) return; // fill in default tooltip params from tool_tip.xml LLToolTip::Params params_with_defaults(params); |