diff options
author | Paul Guslisty <pguslisty@productengine.com> | 2010-07-01 20:00:00 +0300 |
---|---|---|
committer | Paul Guslisty <pguslisty@productengine.com> | 2010-07-01 20:00:00 +0300 |
commit | 5285a7fa7ec67c2337c5f071e6785b143e24c9a6 (patch) | |
tree | 2993f2db8546db1800a7f4abea1d74c447b3339f /indra/llui | |
parent | 207e866fd35c86161ad08c1362cd1f3cfe73ed93 (diff) |
EXT-7565 FIXED Would be nice to preserve selection while switching between folder/list view modes
- Created callback called 'SaveSelecton' (which preserves selection while switching between folder/list view modes) for folder/list view modes buttons in LLPanelOutfitEdit.
- Added 'scrollToShowFirstSelectedItem' method in the LLFlatListView which scrools and shows the first selected item in case multiselection.
- It's possible to set selection for flat list view items before list is build. The result is that any items will be selected. To get rid of it:
1. Overrided LLFlatListView::selectItemByValue method in LLInventoryItemsList so that if list is not created yet, items ids are saved to the vector.
2. Added 'LLInventoryItemsList::updateSelection()' method which selects items with ids from that vector when list is created.
- A little refactoring: moved funcionality of updating WearablesPanel's verb buttons to the separate method called LLPanelOutfitEdit::updateWearablesPanelVerbButtons() to made code more readable and self-explanatory
Reviewed by Vadim Savchuk and Neal Orman at https://codereview.productengine.com/secondlife/r/579/
--HG--
branch : product-engine
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llflatlistview.cpp | 12 | ||||
-rw-r--r-- | indra/llui/llflatlistview.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index b87851490d..a3debdb19a 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -776,6 +776,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()) diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h index ded46d8122..bf72289c47 100644 --- a/indra/llui/llflatlistview.h +++ b/indra/llui/llflatlistview.h @@ -293,6 +293,7 @@ public: bool updateValue(const LLSD& old_value, const LLSD& new_value); + void scrollToShowFirstSelectedItem(); void selectFirstItem (); void selectLastItem (); |