diff options
| author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-06-23 17:24:09 +0100 |
|---|---|---|
| committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-06-23 17:24:09 +0100 |
| commit | 7c409076eee73335a5f0f8901fabc50405e1bac7 (patch) | |
| tree | dad6042b2fe1cb41609f78ec927c45e6aadf5b0d /indra/llui/llflatlistview.cpp | |
| parent | af914e4ab666aad041aa17f6459d1ff834440b44 (diff) | |
| parent | 2583a4d6ea60aeefa1d21f578d6fbf1f2f68c72a (diff) | |
merge from PE's viewer-release.
Diffstat (limited to 'indra/llui/llflatlistview.cpp')
| -rw-r--r-- | indra/llui/llflatlistview.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/indra/llui/llflatlistview.cpp b/indra/llui/llflatlistview.cpp index 2433c14315..c7463e581c 100644 --- a/indra/llui/llflatlistview.cpp +++ b/indra/llui/llflatlistview.cpp @@ -50,14 +50,21 @@ LLFlatListView::Params::Params() allow_select("allow_select"), multi_select("multi_select"), keep_one_selected("keep_one_selected"), + keep_selection_visible_on_reshape("keep_selection_visible_on_reshape",false), no_items_text("no_items_text") {}; void LLFlatListView::reshape(S32 width, S32 height, BOOL called_from_parent /* = TRUE */) { + S32 delta = height - getRect().getHeight(); LLScrollContainer::reshape(width, height, called_from_parent); setItemsNoScrollWidth(width); rearrangeItems(); + + if(delta!= 0 && mKeepSelectionVisibleOnReshape) + { + ensureSelectedVisible(); + } } const LLRect& LLFlatListView::getItemsRect() const @@ -380,6 +387,7 @@ LLFlatListView::LLFlatListView(const LLFlatListView::Params& p) , mPrevNotifyParentRect(LLRect()) , mNoItemsCommentTextbox(NULL) , mIsConsecutiveSelection(false) + , mKeepSelectionVisibleOnReshape(p.keep_selection_visible_on_reshape) { mBorderThickness = getBorderWidth(); |
