summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/llui/llflatlistview.cpp8
-rw-r--r--indra/llui/llflatlistview.h5
-rw-r--r--indra/newview/llwearableitemslist.cpp2
-rw-r--r--indra/newview/skins/default/xui/en/panel_cof_wearables.xml3
-rw-r--r--indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml3
5 files changed, 19 insertions, 2 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();
diff --git a/indra/llui/llflatlistview.h b/indra/llui/llflatlistview.h
index f4e0426f15..0820a7ab67 100644
--- a/indra/llui/llflatlistview.h
+++ b/indra/llui/llflatlistview.h
@@ -105,6 +105,9 @@ public:
/** don't allow to deselect all selected items (for mouse events on items only) */
Optional<bool> keep_one_selected;
+ /** try to keep selection visible after reshape */
+ Optional<bool> keep_selection_visible_on_reshape;
+
/** padding between items */
Optional<U32> item_pad;
@@ -412,6 +415,8 @@ private:
bool mIsConsecutiveSelection;
+ bool mKeepSelectionVisibleOnReshape;
+
/** All pairs of the list */
pairs_list_t mItemPairs;
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index 832d4a2fe6..6aa6ebaa54 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -657,7 +657,7 @@ void LLWearableItemsList::ContextMenu::updateItemsVisibility(LLContextMenu* menu
setMenuItemVisible(menu, "wear_add", mask == MASK_CLOTHING && n_worn == 0);
setMenuItemEnabled(menu, "wear_add", n_items == 1 && canAddWearable(ids.front()));
setMenuItemVisible(menu, "wear", n_worn == 0);
- setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART));
+ setMenuItemVisible(menu, "edit", !standalone && mask & (MASK_CLOTHING|MASK_BODYPART) && n_worn == n_items);
setMenuItemEnabled(menu, "edit", n_editable == 1 && n_worn == 1 && n_items == 1);
setMenuItemVisible(menu, "create_new", mask & (MASK_CLOTHING|MASK_BODYPART) && n_items == 1);
setMenuItemVisible(menu, "show_original", !standalone);
diff --git a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml
index f016c27b0a..d2c8ab159f 100644
--- a/indra/newview/skins/default/xui/en/panel_cof_wearables.xml
+++ b/indra/newview/skins/default/xui/en/panel_cof_wearables.xml
@@ -31,6 +31,7 @@
item_pad="3"
layout="topleft"
left="0"
+ keep_selection_visible_on_reshape="true"
multi_select="true"
name="list_attachments"
top="0"
@@ -45,6 +46,7 @@
follows="all"
height="10"
item_pad="3"
+ keep_selection_visible_on_reshape="true"
layout="topleft"
left="0"
multi_select="true"
@@ -61,6 +63,7 @@
follows="all"
height="10"
item_pad="3"
+ keep_selection_visible_on_reshape="true"
layout="topleft"
left="0"
multi_select="true"
diff --git a/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml b/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml
index dbe1ea2874..49c2abe1a5 100644
--- a/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml
+++ b/indra/newview/skins/default/xui/en/widgets/inventory_list_item.xml
@@ -14,5 +14,6 @@
<!-- style for inventory list item WORN on avatar -->
<worn_style
font="SansSerifSmall"
- font.style="BOLD" />
+ font.style="BOLD"
+ color="green" />
</inventory_list_item>