diff options
author | Merov Linden <merov@lindenlab.com> | 2012-12-13 17:15:18 -0800 |
---|---|---|
committer | Merov Linden <merov@lindenlab.com> | 2012-12-13 17:15:18 -0800 |
commit | 569701cfc898091a414dad0650f89471b1962d49 (patch) | |
tree | 3c8bc31445472747a66d27543b8862ebed511f52 /indra/llui | |
parent | 0e4c3070cb6cfb389d708ca459ed2c721c1cc28a (diff) |
CHUI-574, CHUI-575 : Fixed inventory regressions : select the first filtered item when searching the inventory, simply made the folder selection secondary to item selection.
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llfolderview.h | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/indra/llui/llfolderview.h b/indra/llui/llfolderview.h index 525efe425a..d4a1434c73 100644 --- a/indra/llui/llfolderview.h +++ b/indra/llui/llfolderview.h @@ -341,16 +341,28 @@ public: virtual void doItem(LLFolderViewItem* item) = 0; }; +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +// Class LLSelectFirstFilteredItem +// +// This will select the first *item* found in the hierarchy. If no item can be +// selected, the first matching folder will. +// Since doFolder() is done first but we prioritize item selection, we let the +// first filtered folder set the selection and raise a folder flag. +// The selection might be overridden by the first filtered item in doItem() +// which checks an item flag. Since doFolder() checks the item flag too, the first +// item will still be selected if items were to be done first and folders second. +//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ class LLSelectFirstFilteredItem : public LLFolderViewFunctor { public: - LLSelectFirstFilteredItem() : mItemSelected(FALSE) {} + LLSelectFirstFilteredItem() : mItemSelected(FALSE), mFolderSelected(FALSE) {} virtual ~LLSelectFirstFilteredItem() {} virtual void doFolder(LLFolderViewFolder* folder); virtual void doItem(LLFolderViewItem* item); - BOOL wasItemSelected() { return mItemSelected; } + BOOL wasItemSelected() { return mItemSelected || mFolderSelected; } protected: BOOL mItemSelected; + BOOL mFolderSelected; }; class LLOpenFilteredFolders : public LLFolderViewFunctor |