diff options
Diffstat (limited to 'indra/llui/llflatlistview.cpp')
-rw-r--r-- | indra/llui/llflatlistview.cpp | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index b28399a36b..c57c02f4b1 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -607,8 +607,14 @@ void LLFlatListView::onItemMouseClick(item_pair_t* item_pair, MASK mask) return; } - if (!(mask & MASK_CONTROL) || !mMultipleSelection) resetSelection(); + //no need to do additional commit on selection reset + if (!(mask & MASK_CONTROL) || !mMultipleSelection) resetSelection(true); + + //only CTRL usage allows to deselect an item, usual clicking on an item cannot deselect it + if (mask & MASK_CONTROL) selectItemPair(item_pair, select_item); + else + selectItemPair(item_pair, true); } void LLFlatListView::onItemRightMouseClick(item_pair_t* item_pair, MASK mask) @@ -660,6 +666,14 @@ BOOL LLFlatListView::handleKeyHere(KEY key, MASK mask) } break; } + case KEY_ESCAPE: + { + if (mask == MASK_NONE) + { + setFocus(FALSE); // pass focus to the game area (EXT-8357) + } + break; + } default: break; } @@ -775,6 +789,18 @@ bool LLFlatListView::selectItemPair(item_pair_t* item_pair, bool select) return true; } +void LLFlatListView::scrollToShowFirstSelectedItem() +{ + if (!mSelectedItemPairs.size()) return; + + LLRect selected_rc = mSelectedItemPairs.front()->first->getRect(); + + if (selected_rc.isValid()) + { + scrollToShowRect(selected_rc); + } +} + LLRect LLFlatListView::getLastSelectedItemRect() { if (!mSelectedItemPairs.size()) |