diff options
author | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-06-17 17:42:09 +0300 |
---|---|---|
committer | Sergei Litovchuk <slitovchuk@productengine.com> | 2010-06-17 17:42:09 +0300 |
commit | 8d2ddff47e973c1692b42081e74dba3ad7745fdd (patch) | |
tree | 663ac55b00c356529955e95c84714a9c0913555b | |
parent | 22189c1c46740dbf029465dba913a3ac0f2474bf (diff) |
EXT-7609 FIXED Added worn items indication with bold text.
Fixed updating worn items indication.
Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/551/.
--HG--
branch : product-engine
-rw-r--r-- | indra/newview/llinventoryitemslist.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llinventoryitemslist.h | 7 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 7 | ||||
-rw-r--r-- | indra/newview/llwearableitemslist.cpp | 13 | ||||
-rw-r--r-- | indra/newview/llwearableitemslist.h | 8 |
5 files changed, 30 insertions, 16 deletions
diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index 384b24210c..f7a07b260b 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -80,10 +80,11 @@ void LLPanelInventoryListItemBase::draw() } // virtual -void LLPanelInventoryListItemBase::updateItem(const std::string& name) +void LLPanelInventoryListItemBase::updateItem(const std::string& name, + const LLStyle::Params& input_params) { setIconImage(mIconImage); - setTitle(name, mHighlightedText); + setTitle(name, mHighlightedText, input_params); } void LLPanelInventoryListItemBase::addWidgetToLeftSide(const std::string& name, bool show_widget/* = true*/) @@ -286,13 +287,15 @@ void LLPanelInventoryListItemBase::setIconImage(const LLUIImagePtr& image) } } -void LLPanelInventoryListItemBase::setTitle(const std::string& title, const std::string& highlit_text) +void LLPanelInventoryListItemBase::setTitle(const std::string& title, + const std::string& highlit_text, + const LLStyle::Params& input_params) { setToolTip(title); LLTextUtil::textboxSetHighlightedVal( mTitleCtrl, - LLStyle::Params(), + input_params, title, highlit_text); } diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index 489a82829c..5dc0bfe3de 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -152,7 +152,8 @@ protected: /** * Called after inventory item was updated, update panel widgets to reflect inventory changes. */ - virtual void updateItem(const std::string& name); + virtual void updateItem(const std::string& name, + const LLStyle::Params& input_params = LLStyle::Params()); /** setter for mIconCtrl */ void setIconCtrl(LLIconCtrl* icon) { mIconCtrl = icon; } @@ -177,7 +178,9 @@ protected: void setIconImage(const LLUIImagePtr& image); /** Set item title - inventory item name usually */ - virtual void setTitle(const std::string& title, const std::string& highlit_text); + virtual void setTitle(const std::string& title, + const std::string& highlit_text, + const LLStyle::Params& input_params = LLStyle::Params()); /** * Show tool tip if item name text size > panel size diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index de074d6aaf..8c6189353e 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -44,7 +44,6 @@ #include "llinventorymodel.h" #include "lllistcontextmenu.h" #include "llnotificationsutil.h" -#include "lloutfitobserver.h" #include "llsidetray.h" #include "lltransutil.h" #include "llviewermenu.h" @@ -208,8 +207,10 @@ void LLOutfitsList::onOpen(const LLSD& /*info*/) mCategoriesObserver->addCategory(outfits, boost::bind(&LLOutfitsList::refreshList, this, outfits)); - // Start observing changes in Current Outfit to update items worn state. - LLOutfitObserver::instance().addCOFChangedCallback(boost::bind(&LLOutfitsList::onCOFChanged, this)); + const LLUUID cof = gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT); + + // Start observing changes in Current Outfit category. + mCategoriesObserver->addCategory(cof, boost::bind(&LLOutfitsList::onCOFChanged, this)); // Fetch "My Outfits" contents and refresh the list to display // initially fetched items. If not all items are fetched now diff --git a/indra/newview/llwearableitemslist.cpp b/indra/newview/llwearableitemslist.cpp index ea0c5f1d0f..9c308359fa 100644 --- a/indra/newview/llwearableitemslist.cpp +++ b/indra/newview/llwearableitemslist.cpp @@ -112,16 +112,19 @@ LLPanelWearableOutfitItem::LLPanelWearableOutfitItem(LLViewerInventoryItem* item } // virtual -void LLPanelWearableOutfitItem::updateItem(const std::string& name) +void LLPanelWearableOutfitItem::updateItem(const std::string& name, + const LLStyle::Params& input_params) { std::string search_label = name; + LLStyle::Params style_params = input_params; if (mItem && get_is_item_worn(mItem->getUUID())) { search_label += LLTrans::getString("worn"); + style_params.font.style("BOLD"); } - LLPanelInventoryListItemBase::updateItem(search_label); + LLPanelInventoryListItemBase::updateItem(search_label, style_params); } ////////////////////////////////////////////////////////////////////////// @@ -261,7 +264,9 @@ LLPanelAttachmentListItem* LLPanelAttachmentListItem::create(LLViewerInventoryIt return list_item; } -void LLPanelAttachmentListItem::setTitle(const std::string& title, const std::string& highlit_text) +void LLPanelAttachmentListItem::setTitle(const std::string& title, + const std::string& highlit_text, + const LLStyle::Params& input_params) { std::string title_joint = title; @@ -271,7 +276,7 @@ void LLPanelAttachmentListItem::setTitle(const std::string& title, const std::st title_joint = title + " (" + joint + ")"; } - LLPanelDeletableWearableListItem::setTitle(title_joint, highlit_text); + LLPanelDeletableWearableListItem::setTitle(title_joint, highlit_text, input_params); } ////////////////////////////////////////////////////////////////////////// diff --git a/indra/newview/llwearableitemslist.h b/indra/newview/llwearableitemslist.h index 69134dd646..5dc06284c3 100644 --- a/indra/newview/llwearableitemslist.h +++ b/indra/newview/llwearableitemslist.h @@ -86,8 +86,8 @@ public: /** * Updates item name and (worn) suffix. */ - /*virtual*/ void updateItem(const std::string& name); - + /*virtual*/ void updateItem(const std::string& name, + const LLStyle::Params& input_params = LLStyle::Params()); protected: LLPanelWearableOutfitItem(LLViewerInventoryItem* item); @@ -124,7 +124,9 @@ public: virtual ~LLPanelAttachmentListItem() {}; /** Set item title. Joint name is added to the title in parenthesis */ - /*virtual*/ void setTitle(const std::string& title, const std::string& highlit_text); + /*virtual*/ void setTitle(const std::string& title, + const std::string& highlit_text, + const LLStyle::Params& input_params = LLStyle::Params()); protected: LLPanelAttachmentListItem(LLViewerInventoryItem* item) : LLPanelDeletableWearableListItem(item) {}; |