summaryrefslogtreecommitdiff
path: root/indra/newview/llcofwearables.h
diff options
context:
space:
mode:
authorIgor Borovkov <iborovkov@productengine.com>2010-04-30 15:59:23 +0300
committerIgor Borovkov <iborovkov@productengine.com>2010-04-30 15:59:23 +0300
commit702efd72ab9e3a2c619b5313b481e0821d453070 (patch)
treebbb5afcd258b5640e0bd263abbb6086f560f2d83 /indra/newview/llcofwearables.h
parent2d85ec2d59d7e8b23e82d936271b2e695460c335 (diff)
additional patch for EXT-6732 Create specialized view of inventory for "clothing" accordion tab of outfit editor
* reimplemented button bars as static panels not as list items (creating accordion - button bar - list view - adaptor/container) * added management of items' buttons assording to inventory items' states * assigned actions to clothing/bodyparts items' buttons * got rid of separators as distinct items and made them as part of items * removed ad-hoc up/down buttons * removed "+" button from a button bar Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/322 --HG-- branch : product-engine
Diffstat (limited to 'indra/newview/llcofwearables.h')
-rw-r--r--indra/newview/llcofwearables.h77
1 files changed, 74 insertions, 3 deletions
diff --git a/indra/newview/llcofwearables.h b/indra/newview/llcofwearables.h
index fec6d34db2..c256d2a05d 100644
--- a/indra/newview/llcofwearables.h
+++ b/indra/newview/llcofwearables.h
@@ -36,12 +36,80 @@
#include "llpanel.h"
#include "llinventorymodel.h"
#include "llappearancemgr.h"
+#include "llwearableitemslist.h"
class LLFlatListView;
+/**
+ * Adaptor between LLAccordionCtrlTab and LLFlatListView to facilitate communication between them
+ * (notify, notifyParent) regarding size changes of a list and selection changes across accordion tabs.
+ * Besides that it acts as a container for the LLFlatListView and a button bar on top of it.
+ */
+class LLCOFAccordionListAdaptor : public LLPanel
+{
+public:
+ LLCOFAccordionListAdaptor() : LLPanel() {};
+ ~LLCOFAccordionListAdaptor() {};
+
+ S32 notifyParent(const LLSD& info)
+ {
+ LLView* parent = getParent();
+ if (!parent) return -1;
+
+ if (!info.has("action") || "size_changes" != info["action"])
+ {
+ return parent->notifyParent(info);
+ }
+
+ LLRect rc;
+ childGetRect("button_bar", rc);
+
+ LLSD params;
+ params["action"] = "size_changes";
+ params["width"] = info["width"];
+ params["height"] = info["height"].asInteger() + rc.getHeight();
+
+ return parent->notifyParent(params);
+ }
+
+
+ S32 notify(const LLSD& info)
+ {
+ for (child_list_const_iter_t iter = beginChild(); iter != endChild(); iter++)
+ {
+ if (dynamic_cast<LLFlatListView*>(*iter))
+ {
+ return (*iter)->notify(info);
+ }
+ }
+ return LLPanel::notify(info);
+ };
+};
+
+
class LLCOFWearables : public LLPanel
{
public:
+
+ /**
+ * Represents a collection of callbacks assigned to inventory panel item's buttons
+ */
+ class LLCOFCallbacks
+ {
+ public:
+ LLCOFCallbacks() {};
+ virtual ~LLCOFCallbacks() {};
+
+ typedef boost::function<void (void*)> cof_callback_t;
+
+ cof_callback_t mMoveWearableCloser;
+ cof_callback_t mMoveWearableFurther;
+ cof_callback_t mEditWearable;
+ cof_callback_t mDeleteWearable;
+ };
+
+
+
LLCOFWearables();
virtual ~LLCOFWearables() {};
@@ -52,17 +120,18 @@ public:
void refresh();
void clear();
+ LLCOFCallbacks& getCOFCallbacks() { return mCOFCallbacks; }
+
protected:
void populateAttachmentsAndBodypartsLists(const LLInventoryModel::item_array_t& cof_items);
void populateClothingList(LLAppearanceMgr::wearables_by_type_t& clothing_by_type);
- void addListButtonBar(LLFlatListView* list, std::string xml_filename);
void addClothingTypesDummies(const LLAppearanceMgr::wearables_by_type_t& clothing_by_type);
- void addWearableTypeSeparator(LLFlatListView* list);
void onSelectionChange(LLFlatListView* selected_list);
- LLXMLNodePtr getXMLNode(std::string xml_filename);
+ LLPanelClothingListItem* buildClothingListItem(LLViewerInventoryItem* item, bool first, bool last);
+ LLPanelBodyPartsListItem* buildBodypartListItem(LLViewerInventoryItem* item);
LLFlatListView* mAttachments;
LLFlatListView* mClothing;
@@ -70,6 +139,8 @@ protected:
LLFlatListView* mLastSelectedList;
+ LLCOFCallbacks mCOFCallbacks;
+
};