FIRE-21887: Select first visible item in scroll list if previously selected item gets filtered

Thu, 30 Nov 2017 10:18:29 +0100

author
Ansariel
date
Thu, 30 Nov 2017 10:18:29 +0100
changeset 53507
f5d8ccbfcee0
parent 53506
b87a7ccd5179
child 53508
a583abe7a7f8

FIRE-21887: Select first visible item in scroll list if previously selected item gets filtered

indra/llui/llscrolllistctrl.cpp file | annotate | diff | revisions
     1.1 --- a/indra/llui/llscrolllistctrl.cpp	Thu Nov 30 09:53:39 2017 +0100
     1.2 +++ b/indra/llui/llscrolllistctrl.cpp	Thu Nov 30 10:18:29 2017 +0100
     1.3 @@ -3413,6 +3413,18 @@
     1.4  	std::transform(mFilterString.begin(), mFilterString.end(), mFilterString.begin(), ::tolower);
     1.5  	mIsFiltered = (mFilterColumn > -1 && !mFilterString.empty());
     1.6  	updateLayout();
     1.7 +
     1.8 +	if (mIsFiltered && getNumSelected() > 0 && isFiltered(getFirstSelected()))
     1.9 +	{
    1.10 +		for (item_list::iterator iter = mItemList.begin(); iter != mItemList.end(); iter++)
    1.11 +		{
    1.12 +			if (!isFiltered(*iter))
    1.13 +			{
    1.14 +				selectItem(*iter);
    1.15 +				break;
    1.16 +			}
    1.17 +		}
    1.18 +	}
    1.19  }
    1.20  
    1.21  bool LLScrollListCtrl::isFiltered(const LLScrollListItem* item) const

mercurial