summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDmitry Zaporozhan <dzaporozhan@productengine.com>2010-04-28 20:08:10 +0300
committerDmitry Zaporozhan <dzaporozhan@productengine.com>2010-04-28 20:08:10 +0300
commite1cf84c9b670e764d39c4152df3ed8c705732735 (patch)
treebc744e1ff893264a83f733a2be81314ba37cc980 /indra
parent0dc325502e5c7f44e1cf20315907275190396df3 (diff)
Fixed EXT-6550(major) - Edit Outfit: Fix alignment of in-line edit button and put proper icon on it
Replaced LLPanelInventoryListItem with LLPanelInventoryListItem. This class is capable of showing widgets on left and right sides of panel. Implemented LLPanelClothingListItem and LLPanelBodyPartListItem - makes use of new LLPanelInventoryListItem and is able to show buttons specified in tickets. Buttons are shown on mouse_enter event and hidden on mouse_leave event. Buttons are - delete, move up, move down, lock, edit. It's item's user responsibility to control buttons visibility. Made LLInventoryItemsList::addNewItem virtual to allow inheritors create specific(non-default) items. Reviewed by Mike Antipov - https://codereview.productengine.com/secondlife/r/325/ --HG-- branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r--indra/newview/llcofwearables.cpp10
-rw-r--r--indra/newview/llinventoryitemslist.cpp202
-rw-r--r--indra/newview/llinventoryitemslist.h115
-rw-r--r--indra/newview/llwearableitemslist.cpp154
-rw-r--r--indra/newview/llwearableitemslist.h83
-rw-r--r--indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml73
-rw-r--r--indra/newview/skins/default/xui/en/panel_clothing_list_item.xml106
7 files changed, 696 insertions, 47 deletions
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index e21644e119..88ba6c10df 100644
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -89,6 +89,7 @@ void LLCOFWearables::onSelectionChange(LLFlatListView* selected_list)
onCommit();
}
+#include "llwearableitemslist.h"
void LLCOFWearables::refresh()
{
clear();
@@ -117,16 +118,15 @@ void LLCOFWearables::populateAttachmentsAndBodypartsLists(const LLInventoryModel
const LLAssetType::EType item_type = item->getType();
if (item_type == LLAssetType::AT_CLOTHING) continue;
-
- LLPanelInventoryListItem* item_panel = LLPanelInventoryListItem::createItemPanel(item);
- if (!item_panel) continue;
-
+ LLPanelInventoryListItem* item_panel = NULL;
if (item_type == LLAssetType::AT_OBJECT)
{
+ item_panel = LLPanelInventoryListItemBase::create(item);
mAttachments->addItem(item_panel, item->getUUID(), ADD_BOTTOM, false);
}
else if (item_type == LLAssetType::AT_BODYPART)
{
+ item_panel = LLPanelBodyPartsListItem::create(item);
mBodyParts->addItem(item_panel, item->getUUID(), ADD_BOTTOM, false);
addWearableTypeSeparator(mBodyParts);
}
@@ -165,7 +165,7 @@ void LLCOFWearables::populateClothingList(LLAppearanceMgr::wearables_by_type_t&
{
LLViewerInventoryItem* item = clothing_by_type[type][i];
- LLPanelInventoryListItem* item_panel = LLPanelInventoryListItem::createItemPanel(item);
+ LLPanelInventoryListItem* item_panel = LLPanelClothingListItem::create(item);
if (!item_panel) continue;
mClothing->addItem(item_panel, item->getUUID(), ADD_BOTTOM, false);
diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp
index dca130c672..3d8cb6dfe8 100644
--- a/indra/newview/llinventoryitemslist.cpp
+++ b/indra/newview/llinventoryitemslist.cpp
@@ -50,76 +50,212 @@
////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
-// static
-LLPanelInventoryListItem* LLPanelInventoryListItem::createItemPanel(const LLViewerInventoryItem* item)
+static const S32 WIDGET_SPACING = 3;
+
+LLPanelInventoryListItemBase* LLPanelInventoryListItemBase::create(LLViewerInventoryItem* item)
{
+ LLPanelInventoryListItemBase* list_item = NULL;
if (item)
{
- return new LLPanelInventoryListItem(item);
+ list_item = new LLPanelInventoryListItemBase(item);
+ list_item->init();
}
- else
+ return list_item;
+}
+
+void LLPanelInventoryListItemBase::updateItem()
+{
+ if (mItemIcon.notNull())
+ mIcon->setImage(mItemIcon);
+
+ LLTextUtil::textboxSetHighlightedVal(
+ mTitle,
+ LLStyle::Params(),
+ mItem->getName(),
+ mHighlightedText);
+}
+
+void LLPanelInventoryListItemBase::addWidgetToLeftSide(const std::string& name, bool show_widget/* = true*/)
+{
+ LLUICtrl* ctrl = findChild<LLUICtrl>(name);
+ if(ctrl)
{
- return NULL;
+ addWidgetToLeftSide(ctrl, show_widget);
}
}
-LLPanelInventoryListItem::~LLPanelInventoryListItem()
-{}
+void LLPanelInventoryListItemBase::addWidgetToLeftSide(LLUICtrl* ctrl, bool show_widget/* = true*/)
+{
+ mLeftSideWidgets.push_back(ctrl);
+ setShowWidget(ctrl, show_widget);
+}
-//virtual
-BOOL LLPanelInventoryListItem::postBuild()
+void LLPanelInventoryListItemBase::addWidgetToRightSide(const std::string& name, bool show_widget/* = true*/)
{
+ LLUICtrl* ctrl = findChild<LLUICtrl>(name);
+ if(ctrl)
+ {
+ addWidgetToRightSide(ctrl, show_widget);
+ }
+}
+
+void LLPanelInventoryListItemBase::addWidgetToRightSide(LLUICtrl* ctrl, bool show_widget/* = true*/)
+{
+ mRightSideWidgets.push_back(ctrl);
+ setShowWidget(ctrl, show_widget);
+}
+
+void LLPanelInventoryListItemBase::setShowWidget(const std::string& name, bool show)
+{
+ LLUICtrl* widget = findChild<LLUICtrl>(name);
+ if(widget)
+ {
+ setShowWidget(widget, show);
+ }
+}
+
+void LLPanelInventoryListItemBase::setShowWidget(LLUICtrl* ctrl, bool show)
+{
+ // Enable state determines whether widget may become visible in setWidgetsVisible()
+ ctrl->setEnabled(show);
+}
+
+BOOL LLPanelInventoryListItemBase::postBuild()
+{
+ // Inheritors need to call base implementation
mIcon = getChild<LLIconCtrl>("item_icon");
mTitle = getChild<LLTextBox>("item_name");
updateItem();
+ setWidgetsVisible(false);
+ reshapeWidgets();
+
return TRUE;
}
-//virtual
-void LLPanelInventoryListItem::setValue(const LLSD& value)
+void LLPanelInventoryListItemBase::setValue(const LLSD& value)
{
if (!value.isMap()) return;
if (!value.has("selected")) return;
childSetVisible("selected_icon", value["selected"]);
}
-void LLPanelInventoryListItem::updateItem()
+void LLPanelInventoryListItemBase::onMouseEnter(S32 x, S32 y, MASK mask)
{
- if (mItemIcon.notNull())
- mIcon->setImage(mItemIcon);
+ childSetVisible("hovered_icon", true);
+ LLPanel::onMouseEnter(x, y, mask);
+}
- LLTextUtil::textboxSetHighlightedVal(
- mTitle,
- LLStyle::Params(),
- mItemName,
- mHighlightedText);
+void LLPanelInventoryListItemBase::onMouseLeave(S32 x, S32 y, MASK mask)
+{
+ childSetVisible("hovered_icon", false);
+ LLPanel::onMouseLeave(x, y, mask);
}
-void LLPanelInventoryListItem::onMouseEnter(S32 x, S32 y, MASK mask)
+LLPanelInventoryListItemBase::LLPanelInventoryListItemBase(LLViewerInventoryItem* item)
+: LLPanel()
+, mItem(item)
+, mIcon(NULL)
+, mTitle(NULL)
+, mWidgetSpacing(WIDGET_SPACING)
+, mLeftWidgetsWidth(0)
+, mRightWidgetsWidth(0)
{
- childSetVisible("hovered_icon", true);
+ mItemIcon = get_item_icon(mItem->getType(), mItem->getInventoryType(), mItem->getFlags(), FALSE);
+}
- LLPanel::onMouseEnter(x, y, mask);
+void LLPanelInventoryListItemBase::init()
+{
+ LLUICtrlFactory::getInstance()->buildPanel(this, "panel_inventory_item.xml");
}
-void LLPanelInventoryListItem::onMouseLeave(S32 x, S32 y, MASK mask)
+class WidgetVisibilityChanger
{
- childSetVisible("hovered_icon", false);
+public:
+ WidgetVisibilityChanger(bool visible) : mVisible(visible){}
+ void operator()(LLUICtrl* widget)
+ {
+ // Disabled widgets never become visible. see LLPanelInventoryListItemBase::setShowWidget()
+ widget->setVisible(mVisible && widget->getEnabled());
+ }
+private:
+ bool mVisible;
+};
- LLPanel::onMouseLeave(x, y, mask);
+void LLPanelInventoryListItemBase::setWidgetsVisible(bool visible)
+{
+ std::for_each(mLeftSideWidgets.begin(), mLeftSideWidgets.end(), WidgetVisibilityChanger(visible));
+ std::for_each(mRightSideWidgets.begin(), mRightSideWidgets.end(), WidgetVisibilityChanger(visible));
}
-LLPanelInventoryListItem::LLPanelInventoryListItem(const LLViewerInventoryItem* item)
-: LLPanel()
- ,mIcon(NULL)
- ,mTitle(NULL)
+void LLPanelInventoryListItemBase::reshapeWidgets()
{
- mItemName = item->getName();
- mItemIcon = get_item_icon(item->getType(), item->getInventoryType(), item->getFlags(), FALSE);
+ // disabled reshape left for now to reserve space for 'delete' button in LLPanelClothingListItem
+ /*reshapeLeftWidgets();*/
+ reshapeRightWidgets();
+ reshapeMiddleWidgets();
+}
- LLUICtrlFactory::getInstance()->buildPanel(this, "panel_inventory_item.xml");
+void LLPanelInventoryListItemBase::reshapeLeftWidgets()
+{
+ S32 widget_left = 0;
+ mLeftWidgetsWidth = 0;
+
+ widget_array_t::const_iterator it = mLeftSideWidgets.begin();
+ const widget_array_t::const_iterator it_end = mLeftSideWidgets.end();
+ for( ; it_end != it; ++it)
+ {
+ LLUICtrl* widget = *it;
+ if(!widget->getVisible())
+ {
+ continue;
+ }
+ LLRect widget_rect(widget->getRect());
+ widget_rect.setLeftTopAndSize(widget_left, widget_rect.mTop, widget_rect.getWidth(), widget_rect.getHeight());
+ widget->setShape(widget_rect);
+
+ widget_left += widget_rect.getWidth() + getWidgetSpacing();
+ mLeftWidgetsWidth = widget_rect.mRight;
+ }
+}
+
+void LLPanelInventoryListItemBase::reshapeRightWidgets()
+{
+ S32 widget_right = getLocalRect().getWidth();
+ S32 widget_left = widget_right;
+
+ widget_array_t::const_reverse_iterator it = mRightSideWidgets.rbegin();
+ const widget_array_t::const_reverse_iterator it_end = mRightSideWidgets.rend();
+ for( ; it_end != it; ++it)
+ {
+ LLUICtrl* widget = *it;
+ if(!widget->getVisible())
+ {
+ continue;
+ }
+ LLRect widget_rect(widget->getRect());
+ widget_left = widget_right - widget_rect.getWidth();
+ widget_rect.setLeftTopAndSize(widget_left, widget_rect.mTop, widget_rect.getWidth(), widget_rect.getHeight());
+ widget->setShape(widget_rect);
+
+ widget_right = widget_left - getWidgetSpacing();
+ }
+ mRightWidgetsWidth = getLocalRect().getWidth() - widget_left;
+}
+
+void LLPanelInventoryListItemBase::reshapeMiddleWidgets()
+{
+ LLRect icon_rect(mIcon->getRect());
+ icon_rect.setLeftTopAndSize(mLeftWidgetsWidth + getWidgetSpacing(), icon_rect.mTop,
+ icon_rect.getWidth(), icon_rect.getHeight());
+ mIcon->setShape(icon_rect);
+
+ S32 name_left = icon_rect.mRight + getWidgetSpacing();
+ S32 name_right = getLocalRect().getWidth() - mRightWidgetsWidth - getWidgetSpacing();
+ LLRect name_rect(mTitle->getRect());
+ name_rect.set(name_left, name_rect.mTop, name_right, name_rect.mBottom);
+ mTitle->setShape(name_rect);
}
////////////////////////////////////////////////////////////////////////////////
@@ -223,7 +359,7 @@ void LLInventoryItemsList::addNewItem(LLViewerInventoryItem* item)
llassert(!"No inventory item. Couldn't create flat list item.");
}
- LLPanelInventoryListItem *list_item = LLPanelInventoryListItem::createItemPanel(item);
+ LLPanelInventoryListItemBase *list_item = LLPanelInventoryListItemBase::create(item);
if (!list_item)
return;
diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h
index b496f4b9e9..15f04c79a9 100644
--- a/indra/newview/llinventoryitemslist.h
+++ b/indra/newview/llinventoryitemslist.h
@@ -47,33 +47,130 @@ class LLIconCtrl;
class LLTextBox;
class LLViewerInventoryItem;
-class LLPanelInventoryListItem : public LLPanel
+/**
+ * @class LLPanelInventoryListItemBase
+ *
+ * Base class for Inventory flat list item. Panel consists of inventory icon
+ * and inventory item name.
+ * This class is able to display widgets(buttons) on left(before icon) and right(after text-box) sides
+ * of panel.
+ *
+ * How to use (see LLPanelClothingListItem for example):
+ * - implement init() to build panel from xml
+ * - create new xml file, fill it with widgets you want to dynamically show/hide/reshape on left/right sides
+ * - redefine postBuild()(call base implementation) and add needed widgets to needed sides,
+ *
+ */
+class LLPanelInventoryListItemBase : public LLPanel
{
public:
- static LLPanelInventoryListItem* createItemPanel(const LLViewerInventoryItem* item);
- virtual ~LLPanelInventoryListItem();
+ static LLPanelInventoryListItemBase* create(LLViewerInventoryItem* item);
+
+ /**
+ * Called after inventory item was updated, update panel widgets to reflect inventory changes.
+ */
+ virtual void updateItem();
+
+ /**
+ * Add widget to left side
+ */
+ void addWidgetToLeftSide(const std::string& name, bool show_widget = true);
+ void addWidgetToLeftSide(LLUICtrl* ctrl, bool show_widget = true);
+
+ /**
+ * Add widget to right side, widget is supposed to be child of calling panel
+ */
+ void addWidgetToRightSide(const std::string& name, bool show_widget = true);
+ void addWidgetToRightSide(LLUICtrl* ctrl, bool show_widget = true);
+
+ /**
+ * Mark widgets as visible. Only visible widgets take part in reshaping children
+ */
+ void setShowWidget(const std::string& name, bool show);
+ void setShowWidget(LLUICtrl* ctrl, bool show);
+
+ /**
+ * Set spacing between widgets during reshape
+ */
+ void setWidgetSpacing(S32 spacing) { mWidgetSpacing = spacing; }
+
+ S32 getWidgetSpacing() { return mWidgetSpacing; }
+ /**
+ * Inheritors need to call base implementation of postBuild()
+ */
/*virtual*/ BOOL postBuild();
+
+ /**
+ * Handles item selection
+ */
/*virtual*/ void setValue(const LLSD& value);
- void updateItem();
+ /* Highlights item */
+ /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask);
+ /* Removes item highlight */
+ /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
- void onMouseEnter(S32 x, S32 y, MASK mask);
- void onMouseLeave(S32 x, S32 y, MASK mask);
+ virtual ~LLPanelInventoryListItemBase(){}
protected:
- LLPanelInventoryListItem(const LLViewerInventoryItem* item);
+
+ LLPanelInventoryListItemBase(LLViewerInventoryItem* item);
+
+ typedef std::vector<LLUICtrl*> widget_array_t;
+
+ /**
+ * Use it from a factory function to build panel, do not build panel in constructor
+ */
+ virtual void init();
+
+ void setLeftWidgetsWidth(S32 width) { mLeftWidgetsWidth = width; }
+ void setRightWidgetsWidth(S32 width) { mRightWidgetsWidth = width; }
+
+ /**
+ * Set all widgets from both side visible/invisible. Only enabled widgets
+ * (see setShowWidget()) can become visible
+ */
+ virtual void setWidgetsVisible(bool visible);
+
+ /**
+ * Reshape all child widgets - icon, text-box and side widgets
+ */
+ virtual void reshapeWidgets();
private:
+
+ /** reshape left side widgets
+ * Deprecated for now. Disabled reshape left for now to reserve space for 'delete'
+ * button in LLPanelClothingListItem according to Neal's comment (https://codereview.productengine.com/secondlife/r/325/)
+ */
+ void reshapeLeftWidgets();
+
+ /** reshape right side widgets */
+ void reshapeRightWidgets();
+
+ /** reshape remaining widgets */
+ void reshapeMiddleWidgets();
+
+ LLViewerInventoryItem* mItem;
+
LLIconCtrl* mIcon;
LLTextBox* mTitle;
LLUIImagePtr mItemIcon;
- std::string mItemName;
std::string mHighlightedText;
+
+ widget_array_t mLeftSideWidgets;
+ widget_array_t mRightSideWidgets;
+ S32 mWidgetSpacing;
+
+ S32 mLeftWidgetsWidth;
+ S32 mRightWidgetsWidth;
};
+//////////////////////////////////////////////////////////////////////////
+
class LLInventoryItemsList : public LLFlatListView
{
public:
@@ -117,7 +214,7 @@ protected:
/**
* Add an item to the list
*/
- void addNewItem(LLViewerInventoryItem* item);
+ virtual void addNewItem(LLViewerInventoryItem* item);
private:
uuid_vec_t mIDs; // IDs of items that were added in refreshList().
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index 3d110dcc78..b8fab63be9 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -60,6 +60,158 @@ bool LLFindOutfitItems::operator()(LLInventoryCategory* cat,
return FALSE;
}
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
+void LLPanelWearableListItem::onMouseEnter(S32 x, S32 y, MASK mask)
+{
+ LLPanelInventoryListItemBase::onMouseEnter(x, y, mask);
+ setWidgetsVisible(true);
+ reshapeWidgets();
+}
+
+void LLPanelWearableListItem::onMouseLeave(S32 x, S32 y, MASK mask)
+{
+ LLPanelInventoryListItemBase::onMouseLeave(x, y, mask);
+ setWidgetsVisible(false);
+ reshapeWidgets();
+}
+
+LLPanelWearableListItem::LLPanelWearableListItem(LLViewerInventoryItem* item)
+: LLPanelInventoryListItemBase(item)
+{
+}
+
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
+// static
+LLPanelClothingListItem* LLPanelClothingListItem::create(LLViewerInventoryItem* item)
+{
+ LLPanelClothingListItem* list_item = NULL;
+ if(item)
+ {
+ list_item = new LLPanelClothingListItem(item);
+ list_item->init();
+ }
+ return list_item;
+}
+
+LLPanelClothingListItem::LLPanelClothingListItem(LLViewerInventoryItem* item)
+ : LLPanelWearableListItem(item)
+{
+}
+
+LLPanelClothingListItem::~LLPanelClothingListItem()
+{
+}
+
+void LLPanelClothingListItem::init()
+{
+ LLUICtrlFactory::getInstance()->buildPanel(this, "panel_clothing_list_item.xml");
+}
+
+BOOL LLPanelClothingListItem::postBuild()
+{
+ LLPanelInventoryListItemBase::postBuild();
+
+ addWidgetToLeftSide("btn_delete");
+ addWidgetToRightSide("btn_move_up");
+ addWidgetToRightSide("btn_move_down");
+ addWidgetToRightSide("btn_lock");
+ addWidgetToRightSide("btn_edit");
+
+ LLButton* delete_btn = getChild<LLButton>("btn_delete");
+ // Reserve space for 'delete' button event if it is invisible.
+ setLeftWidgetsWidth(delete_btn->getRect().mRight);
+
+ setWidgetsVisible(false);
+ reshapeWidgets();
+
+ return TRUE;
+}
+
+void LLPanelClothingListItem::setShowDeleteButton(bool show)
+{
+ setShowWidget("btn_delete", show);
+}
+
+void LLPanelClothingListItem::setShowMoveUpButton(bool show)
+{
+ setShowWidget("btn_move_up", show);
+}
+
+void LLPanelClothingListItem::setShowMoveDownButton(bool show)
+{
+ setShowWidget("btn_move_down", show);
+}
+
+void LLPanelClothingListItem::setShowLockButton(bool show)
+{
+ setShowWidget("btn_lock", show);
+}
+
+void LLPanelClothingListItem::setShowEditButton(bool show)
+{
+ setShowWidget("btn_edit", show);
+}
+
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
+// static
+LLPanelBodyPartsListItem* LLPanelBodyPartsListItem::create(LLViewerInventoryItem* item)
+{
+ LLPanelBodyPartsListItem* list_item = NULL;
+ if(item)
+ {
+ list_item = new LLPanelBodyPartsListItem(item);
+ list_item->init();
+ }
+ return list_item;
+}
+
+LLPanelBodyPartsListItem::LLPanelBodyPartsListItem(LLViewerInventoryItem* item)
+: LLPanelWearableListItem(item)
+{
+}
+
+LLPanelBodyPartsListItem::~LLPanelBodyPartsListItem()
+{
+}
+
+void LLPanelBodyPartsListItem::init()
+{
+ LLUICtrlFactory::getInstance()->buildPanel(this, "panel_body_parts_list_item.xml");
+}
+
+BOOL LLPanelBodyPartsListItem::postBuild()
+{
+ LLPanelInventoryListItemBase::postBuild();
+
+ addWidgetToRightSide("btn_lock");
+ addWidgetToRightSide("btn_edit");
+
+ return TRUE;
+}
+
+void LLPanelBodyPartsListItem::setShowLockButton(bool show)
+{
+ setShowWidget("btn_lock", show);
+}
+
+void LLPanelBodyPartsListItem::setShowEditButton(bool show)
+{
+ setShowWidget("btn_edit", show);
+}
+
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+//////////////////////////////////////////////////////////////////////////
+
static const LLDefaultChildRegistry::Register<LLWearableItemsList> r("wearable_items_list");
LLWearableItemsList::Params::Params()
@@ -89,3 +241,5 @@ void LLWearableItemsList::updateList(const LLUUID& category_id)
refreshList(item_array);
}
+
+// EOF
diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h
index e7ccba8e6c..ae43b3f673 100644
--- a/indra/newview/llwearableitemslist.h
+++ b/indra/newview/llwearableitemslist.h
@@ -36,6 +36,89 @@
// newview
#include "llinventoryitemslist.h"
+#include "llinventorymodel.h"
+#include "llwearabledictionary.h"
+
+/**
+ * @class LLPanelWearableListItem
+ *
+ * Extends LLPanelInventoryListItemBase:
+ * - makes side widgets show on mouse_enter and hide on
+ * mouse_leave events.
+ * - provides callback for button clicks
+ */
+class LLPanelWearableListItem : public LLPanelInventoryListItemBase
+{
+ LOG_CLASS(LLPanelWearableListItem);
+public:
+
+ /**
+ * Shows buttons when mouse is over
+ */
+ /*virtual*/ void onMouseEnter(S32 x, S32 y, MASK mask);
+
+ /**
+ * Hides buttons when mouse is out
+ */
+ /*virtual*/ void onMouseLeave(S32 x, S32 y, MASK mask);
+
+protected:
+
+ LLPanelWearableListItem(LLViewerInventoryItem* item);
+};
+
+/**
+ * @class LLPanelClothingListItem
+ *
+ * Provides buttons for editing, moving, deleting a wearable.
+ */
+class LLPanelClothingListItem : public LLPanelWearableListItem
+{
+ LOG_CLASS(LLPanelClothingListItem);
+public:
+
+ static LLPanelClothingListItem* create(LLViewerInventoryItem* item);
+
+ virtual ~LLPanelClothingListItem();
+
+ /*virtual*/ void init();
+ /*virtual*/ BOOL postBuild();
+
+ /**
+ * Make button visible during mouse over event.
+ */
+ inline void setShowDeleteButton(bool show);
+ inline void setShowMoveUpButton(bool show);
+ inline void setShowMoveDownButton(bool show);
+ inline void setShowLockButton(bool show);
+ inline void setShowEditButton(bool show);
+
+protected:
+
+ LLPanelClothingListItem(LLViewerInventoryItem* item);
+};
+
+class LLPanelBodyPartsListItem : public LLPanelWearableListItem
+{
+ LOG_CLASS(LLPanelBodyPartsListItem);
+public:
+
+ static LLPanelBodyPartsListItem* create(LLViewerInventoryItem* item);
+
+ virtual ~LLPanelBodyPartsListItem();
+
+ /*virtual*/ void init();
+ /*virtual*/ BOOL postBuild();
+
+ /**
+ * Make button visible during mouse over event.
+ */
+ inline void setShowLockButton(bool show);
+ inline void setShowEditButton(bool show);
+
+protected:
+ LLPanelBodyPartsListItem(LLViewerInventoryItem* item);
+};
/**
* @class LLWearableItemsList
diff --git a/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml b/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml
new file mode 100644
index 0000000000..445f677c94
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_body_parts_list_item.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ follows="top|right|left"
+ height="20"
+ layout="topleft"
+ left="0"
+ name="wearable_item"
+ top="0"
+ width="380">
+ <icon
+ follows="top|right|left"
+ height="20"
+ image_name="ListItem_Over"
+ layout="topleft"
+ left="0"
+ name="hovered_icon"
+ top="0"
+ visible="false"
+ width="380" />
+ <icon
+ height="20"
+ follows="top|right|left"
+ image_name="ListItem_Select"
+ layout="topleft"
+ left="0"
+ name="selected_icon"
+ top="0"
+ visible="false"
+ width="380" />
+ <icon
+ height="16"
+ follows="top|left"
+ image_name="Inv_Object"
+ layout="topleft"
+ left="0"
+ name="item_icon"
+ top="2"
+ width="16" />
+ <text
+ follows="left|right"
+ height="16"
+ layout="topleft"
+ left_pad="5"
+ allow_html="false"
+ use_ellipses="true"
+ name="item_name"
+ text_color="white"
+ top="4"
+ value="..."
+ width="359" />
+ <button
+ name="btn_lock"
+ layout="topleft"
+ follows="top|right"
+ image_unselected="Lock2"
+ image_selected="Lock2"
+ top="0"
+ left_pad="3"
+ height="20"
+ width="20"
+ tab_stop="false" />
+ <button
+ name="btn_edit"
+ layout="topleft"
+ follows="top|right"
+ image_unselected="Icon_Gear_Background"
+ image_selected="Icon_Gear_Background"
+ top="0"
+ left_pad="3"
+ height="20"
+ width="20"
+ tab_stop="false" />
+</panel>
diff --git a/indra/newview/skins/default/xui/en/panel_clothing_list_item.xml b/indra/newview/skins/default/xui/en/panel_clothing_list_item.xml
new file mode 100644
index 0000000000..386b3b2c4f
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_clothing_list_item.xml
@@ -0,0 +1,106 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ follows="top|right|left"
+ height="20"
+ layout="topleft"
+ left="0"
+ name="wearable_item"
+ top="0"
+ width="380">
+ <icon
+ follows="top|right|left"
+ height="20"
+ image_name="ListItem_Over"
+ layout="topleft"
+ left="0"
+ name="hovered_icon"
+ top="0"
+ visible="false"
+ width="380" />
+ <icon
+ height="20"
+ follows="top|right|left"
+ image_name="ListItem_Select"
+ layout="topleft"
+ left="0"
+ name="selected_icon"
+ top="0"
+ visible="false"
+ width="380" />
+ <button
+ name="btn_delete"
+ layout="topleft"
+ follows="top|left"
+ image_unselected="Toast_CloseBtn"
+ image_selected="Toast_CloseBtn"
+ top="0"
+ left="0"
+ height="20"
+ width="20"
+ tab_stop="false" />
+ <icon
+ height="16"
+ follows="top|left"
+ image_name="Inv_Object"
+ layout="topleft"
+ left_pad="3"
+ name="item_icon"
+ top="2"
+ width="16" />
+ <text
+ follows="left|right"
+ height="16"
+ layout="topleft"
+ left_pad="5"
+ allow_html="false"
+ use_ellipses="true"
+ name="item_name"
+ text_color="white"
+ top="4"
+ value="..."
+ width="359" />
+ <button
+ name="btn_move_up"
+ layout="topleft"
+ follows="top|right"
+ image_unselected="Movement_Up_Off"
+ image_selected="Movement_Up_Off"
+ top="0"
+ left="0"
+ height="20"
+ width="20"
+ tab_stop="false" />
+ <button
+ name="btn_move_down"
+ layout="topleft"
+ follows="top|right"
+ image_unselected="Movement_Down_Off"
+ image_selected="Movement_Down_Off"
+ top="0"
+ left_pad="3"
+ height="20"
+ width="20"
+ tab_stop="false" />
+ <button
+ name="btn_lock"
+ layout="topleft"
+ follows="top|right"
+ image_unselected="Lock2"
+ image_selected="Lock2"
+ top="0"
+ left_pad="3"
+ height="20"
+ width="20"
+ tab_stop="false" />
+ <button
+ name="btn_edit"
+ layout="topleft"
+ follows="top|right"
+ image_unselected="Icon_Gear_Background"
+ image_selected="Icon_Gear_Background"
+ top="0"
+ left_pad="3"
+ height="20"
+ width="20"
+ tab_stop="false" />
+</panel>