diff options
author | Igor Borovkov <iborovkov@productengine.com> | 2010-05-13 13:25:02 +0300 |
---|---|---|
committer | Igor Borovkov <iborovkov@productengine.com> | 2010-05-13 13:25:02 +0300 |
commit | 2ab9fbf019b579e0130b75769bd3c862040480a8 (patch) | |
tree | b54618df93c674652583c8bcef9de4db65737821 /indra | |
parent | 1b41e68636a43e2efc88faae29496895e882e0d0 (diff) |
EXT-7218 FIXED added a delete button for attachment items (panel outfit edit)
added a deletable wearable item, predecessor of a clothing item, which is used for attachment items
Reviewed by Neal Orman and Mike Antipov at https://codereview.productengine.com/secondlife/r/377
--HG--
branch : product-engine
Diffstat (limited to 'indra')
-rw-r--r-- | indra/newview/llcofwearables.cpp | 17 | ||||
-rw-r--r-- | indra/newview/llcofwearables.h | 1 | ||||
-rw-r--r-- | indra/newview/llwearableitemslist.cpp | 49 | ||||
-rw-r--r-- | indra/newview/llwearableitemslist.h | 48 | ||||
-rw-r--r-- | indra/newview/skins/default/xui/en/panel_deletable_wearable_list_item.xml | 73 |
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> |