diff options
author | Yuri Chebotarev <ychebotarev@productengine.com> | 2010-06-23 17:43:43 +0300 |
---|---|---|
committer | Yuri Chebotarev <ychebotarev@productengine.com> | 2010-06-23 17:43:43 +0300 |
commit | ce9ac6501461eca8acd2c1074d71a9ed6df13df3 (patch) | |
tree | 369e33aa6da4670a1c03eafde1b34d2ca124117c /indra/llui/llflatlistview.cpp | |
parent | 7132b7485eac8a73c5c3f68cfeadc6509c106145 (diff) |
EXT-7963 FIX introduce new variable "keep_selection_visible_on_reshape" and use it for "edit outfit" flatlist controls.
reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/641/
--HG--
branch : product-engine
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(); |