summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indra/newview/llcofwearables.cpp17
-rw-r--r--indra/newview/llcofwearables.h1
-rw-r--r--indra/newview/llwearableitemslist.cpp49
-rw-r--r--indra/newview/llwearableitemslist.h48
-rw-r--r--indra/newview/skins/default/xui/en/panel_deletable_wearable_list_item.xml73
5 files changed, 156 insertions, 32 deletions
diff --git a/indra/newview/llcofwearables.cpp b/indra/newview/llcofwearables.cpp
index c73aa5f415..498aeec682 100644
--- a/indra/newview/llcofwearables.cpp
+++ b/indra/newview/llcofwearables.cpp
@@ -150,7 +150,7 @@ void LLCOFWearables::populateAttachmentsAndBodypartsLists(const LLInventoryModel
LLPanelInventoryListItemBase* item_panel = NULL;
if (item_type == LLAssetType::AT_OBJECT)
{
- item_panel = LLPanelInventoryListItemBase::create(item);
+ item_panel = buildAttachemntListItem(item);
mAttachments->addItem(item_panel, item->getUUID(), ADD_BOTTOM, false);
}
else if (item_type == LLAssetType::AT_BODYPART)
@@ -232,6 +232,21 @@ LLPanelBodyPartsListItem* LLCOFWearables::buildBodypartListItem(LLViewerInventor
return item_panel;
}
+LLPanelDeletableWearableListItem* LLCOFWearables::buildAttachemntListItem(LLViewerInventoryItem* item)
+{
+ llassert(item);
+ if (!item) return NULL;
+
+ LLPanelDeletableWearableListItem* item_panel = LLPanelDeletableWearableListItem::create(item);
+ if (!item_panel) return NULL;
+
+ //setting callbacks
+ //*TODO move that item panel's inner structure disclosing stuff into the panels
+ item_panel->childSetAction("btn_delete", mCOFCallbacks.mDeleteWearable);
+
+ return item_panel;
+}
+
void LLCOFWearables::populateClothingList(LLAppearanceMgr::wearables_by_type_t& clothing_by_type)
{
llassert(clothing_by_type.size() == LLWearableType::WT_COUNT);
diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h
index 2d26bf781f..32acba5a3e 100644
--- a/indra/newview/llcofwearables.h
+++ b/indra/newview/llcofwearables.h
@@ -132,6 +132,7 @@ protected:
LLPanelClothingListItem* buildClothingListItem(LLViewerInventoryItem* item, bool first, bool last);
LLPanelBodyPartsListItem* buildBodypartListItem(LLViewerInventoryItem* item);
+ LLPanelDeletableWearableListItem* buildAttachemntListItem(LLViewerInventoryItem* item);
LLFlatListView* mAttachments;
LLFlatListView* mClothing;
diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp
index 26f6bc47cd..bac66d966a 100644
--- a/indra/newview/llwearableitemslist.cpp
+++ b/indra/newview/llwearableitemslist.cpp
@@ -103,7 +103,7 @@ LLPanelClothingListItem* LLPanelClothingListItem::create(LLViewerInventoryItem*
}
LLPanelClothingListItem::LLPanelClothingListItem(LLViewerInventoryItem* item)
- : LLPanelWearableListItem(item)
+ : LLPanelDeletableWearableListItem(item)
{
}
@@ -118,18 +118,13 @@ void LLPanelClothingListItem::init()
BOOL LLPanelClothingListItem::postBuild()
{
- LLPanelInventoryListItemBase::postBuild();
+ LLPanelDeletableWearableListItem::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();
@@ -176,6 +171,46 @@ BOOL LLPanelBodyPartsListItem::postBuild()
return TRUE;
}
+
+// static
+LLPanelDeletableWearableListItem* LLPanelDeletableWearableListItem::create(LLViewerInventoryItem* item)
+{
+ LLPanelDeletableWearableListItem* list_item = NULL;
+ if(item)
+ {
+ list_item = new LLPanelDeletableWearableListItem(item);
+ list_item->init();
+ }
+ return list_item;
+}
+
+LLPanelDeletableWearableListItem::LLPanelDeletableWearableListItem(LLViewerInventoryItem* item)
+: LLPanelWearableListItem(item)
+{
+}
+
+void LLPanelDeletableWearableListItem::init()
+{
+ LLUICtrlFactory::getInstance()->buildPanel(this, "panel_deletable_wearable_list_item.xml");
+}
+
+BOOL LLPanelDeletableWearableListItem::postBuild()
+{
+ LLPanelWearableListItem::postBuild();
+
+ addWidgetToLeftSide("btn_delete");
+
+ 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;
+}
+
+
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h
index b7f3fd0dff..5e3202c687 100644
--- a/indra/newview/llwearableitemslist.h
+++ b/indra/newview/llwearableitemslist.h
@@ -67,12 +67,35 @@ protected:
LLPanelWearableListItem(LLViewerInventoryItem* item);
};
+
+class LLPanelDeletableWearableListItem : public LLPanelWearableListItem
+{
+ LOG_CLASS(LLPanelDeletableWearableListItem);
+public:
+
+ static LLPanelDeletableWearableListItem* create(LLViewerInventoryItem* item);
+
+ virtual ~LLPanelDeletableWearableListItem() {};
+
+ /*virtual*/ BOOL postBuild();
+
+ /**
+ * Make button visible during mouse over event.
+ */
+ inline void setShowDeleteButton(bool show) { setShowWidget("btn_delete", show); }
+
+protected:
+ LLPanelDeletableWearableListItem(LLViewerInventoryItem* item);
+
+ /*virtual*/ void init();
+};
+
/**
* @class LLPanelClothingListItem
*
* Provides buttons for editing, moving, deleting a wearable.
*/
-class LLPanelClothingListItem : public LLPanelWearableListItem
+class LLPanelClothingListItem : public LLPanelDeletableWearableListItem
{
LOG_CLASS(LLPanelClothingListItem);
public:
@@ -86,7 +109,6 @@ public:
/**
* Make button visible during mouse over event.
*/
- inline void setShowDeleteButton(bool show) { setShowWidget("btn_delete", show); }
inline void setShowMoveUpButton(bool show) { setShowWidget("btn_move_up", show); }
inline void setShowMoveDownButton(bool show) { setShowWidget("btn_move_down", show); }
@@ -125,28 +147,6 @@ protected:
};
-class LLPanelDeletableWearableListItem : public LLPanelWearableListItem
-{
- LOG_CLASS(LLPanelDeletableWearableListItem);
-public:
-
- static LLPanelDeletableWearableListItem* create(LLViewerInventoryItem* item);
-
- virtual ~LLPanelDeletableWearableListItem();
-
- /*virtual*/ BOOL postBuild();
-
- /**
- * Make button visible during mouse over event.
- */
- inline void setShowDeleteButton(bool show) { setShowWidget("btn_delete", show); }
-
-protected:
- LLPanelDeletableWearableListItem(LLViewerInventoryItem* item);
-
- /*virtual*/ void init();
-};
-
/**
* @class LLPanelDummyClothingListItem
*
diff --git a/indra/newview/skins/default/xui/en/panel_deletable_wearable_list_item.xml b/indra/newview/skins/default/xui/en/panel_deletable_wearable_list_item.xml
new file mode 100644
index 0000000000..2f37b9d3c9
--- /dev/null
+++ b/indra/newview/skins/default/xui/en/panel_deletable_wearable_list_item.xml
@@ -0,0 +1,73 @@
+<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
+<panel
+ follows="top|right|left"
+ height="23"
+ layout="topleft"
+ left="0"
+ name="deletable_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" />
+ <panel
+ background_visible="true"
+ bg_alpha_color="0.4 0.4 0.4 1.0"
+ bottom="0"
+ follows="left|right|top"
+ height="1"
+ layout="bottomleft"
+ left="0"
+ name="wearable_type_separator_panel"
+ visible="true"
+ width="380"/>
+</panel>