diff options
Diffstat (limited to 'indra/newview')
-rw-r--r-- | indra/newview/lloutfitslist.cpp | 17 | ||||
-rw-r--r-- | indra/newview/lloutfitslist.h | 18 |
2 files changed, 33 insertions, 2 deletions
diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index a4ae957c76..e20b2e26be 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -53,6 +53,20 @@ static bool is_tab_header_clicked(LLAccordionCtrlTab* tab, S32 y); +static const LLOutfitTabNameComparator OUTFIT_TAB_NAME_COMPARATOR; + +/*virtual*/ +bool LLOutfitTabNameComparator::compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const +{ + std::string name1 = tab1->getTitle(); + std::string name2 = tab2->getTitle(); + + LLStringUtil::toUpper(name1); + LLStringUtil::toUpper(name2); + + return name1 < name2; +} + ////////////////////////////////////////////////////////////////////////// class OutfitContextMenu : public LLListContextMenu @@ -158,6 +172,7 @@ LLOutfitsList::~LLOutfitsList() BOOL LLOutfitsList::postBuild() { mAccordion = getChild<LLAccordionCtrl>("outfits_accordion"); + mAccordion->setComparator(&OUTFIT_TAB_NAME_COMPARATOR); return TRUE; } @@ -328,7 +343,7 @@ void LLOutfitsList::refreshList(const LLUUID& category_id) updateOutfitTab(*items_iter); } - mAccordion->arrange(); + mAccordion->sort(); } void LLOutfitsList::onSelectionChange(LLUICtrl* ctrl) diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 44f6ec908b..bb516446d2 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -32,18 +32,34 @@ #ifndef LL_LLOUTFITSLIST_H #define LL_LLOUTFITSLIST_H +#include "llaccordionctrl.h" #include "llpanel.h" // newview #include "llinventorymodel.h" #include "llinventoryobserver.h" -class LLAccordionCtrl; class LLAccordionCtrlTab; class LLWearableItemsList; class LLListContextMenu; /** + * @class LLOutfitTabNameComparator + * + * Comparator of outfit tabs. + */ +class LLOutfitTabNameComparator : public LLAccordionCtrl::LLTabComparator +{ + LOG_CLASS(LLOutfitTabNameComparator); + +public: + LLOutfitTabNameComparator() {}; + virtual ~LLOutfitTabNameComparator() {}; + + /*virtual*/ bool compare(const LLAccordionCtrlTab* tab1, const LLAccordionCtrlTab* tab2) const; +}; + +/** * @class LLOutfitsList * * A list of agents's outfits from "My Outfits" inventory category |