diff options
Diffstat (limited to 'indra/newview/llgrouplist.cpp')
-rwxr-xr-x[-rw-r--r--] | indra/newview/llgrouplist.cpp | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/indra/newview/llgrouplist.cpp b/indra/newview/llgrouplist.cpp index c3e6e1c2dc..ef238cefe3 100644..100755 --- a/indra/newview/llgrouplist.cpp +++ b/indra/newview/llgrouplist.cpp @@ -50,6 +50,8 @@ S32 LLGroupListItem::sIconWidth = 0; class LLGroupComparator : public LLFlatListView::ItemComparator { public: + LLGroupComparator() {}; + /** Returns true if item1 < item2, false otherwise */ /*virtual*/ bool compare(const LLPanel* item1, const LLPanel* item2) const { @@ -86,7 +88,7 @@ LLGroupList::LLGroupList(const Params& p) registrar.add("People.Groups.Action", boost::bind(&LLGroupList::onContextMenuItemClick, this, _2)); enable_registrar.add("People.Groups.Enable", boost::bind(&LLGroupList::onContextMenuItemEnable, this, _2)); - LLMenuGL* context_menu = LLUICtrlFactory::getInstance()->createFromFile<LLMenuGL>("menu_people_groups.xml", + LLToggleableMenu* context_menu = LLUICtrlFactory::getInstance()->createFromFile<LLToggleableMenu>("menu_people_groups.xml", gMenuHolder, LLViewerMenuHolderGL::child_registry_t::instance()); if(context_menu) mContextMenuHandle = context_menu->getHandle(); @@ -95,7 +97,7 @@ LLGroupList::LLGroupList(const Params& p) LLGroupList::~LLGroupList() { gAgent.removeListener(this); - LLView::deleteViewByHandle(mContextMenuHandle); + if (mContextMenuHandle.get()) mContextMenuHandle.get()->die(); } // virtual @@ -112,7 +114,7 @@ BOOL LLGroupList::handleRightMouseDown(S32 x, S32 y, MASK mask) { BOOL handled = LLUICtrl::handleRightMouseDown(x, y, mask); - LLMenuGL* context_menu = (LLMenuGL*)mContextMenuHandle.get(); + LLToggleableMenu* context_menu = mContextMenuHandle.get(); if (context_menu && size() > 0) { context_menu->buildDrawLabels(); @@ -123,6 +125,22 @@ BOOL LLGroupList::handleRightMouseDown(S32 x, S32 y, MASK mask) return handled; } +// virtual +BOOL LLGroupList::handleDoubleClick(S32 x, S32 y, MASK mask) +{ + BOOL handled = LLView::handleDoubleClick(x, y, mask); + // Handle double click only for the selected item in the list, skip clicks on empty space. + if (handled) + { + if (mDoubleClickSignal) + { + (*mDoubleClickSignal)(this, x, y, mask); + } + } + + return handled; +} + void LLGroupList::setNameFilter(const std::string& filter) { std::string filter_upper = filter; @@ -147,7 +165,7 @@ static bool findInsensitive(std::string haystack, const std::string& needle_uppe void LLGroupList::refresh() { const LLUUID& highlight_id = gAgent.getGroupID(); - S32 count = gAgent.mGroups.count(); + S32 count = gAgent.mGroups.size(); LLUUID id; bool have_filter = !mNameFilter.empty(); @@ -155,8 +173,8 @@ void LLGroupList::refresh() for(S32 i = 0; i < count; ++i) { - id = gAgent.mGroups.get(i).mID; - const LLGroupData& group_data = gAgent.mGroups.get(i); + id = gAgent.mGroups.at(i).mID; + const LLGroupData& group_data = gAgent.mGroups.at(i); if (have_filter && !findInsensitive(group_data.mName, mNameFilter)) continue; addNewItem(id, group_data.mName, group_data.mInsigniaID, ADD_BOTTOM); @@ -390,7 +408,7 @@ void LLGroupListItem::setActive(bool active) // *BUG: setName() overrides the style params. // Active group should be bold. - LLFontDescriptor new_desc(mGroupNameBox->getDefaultFont()->getFontDesc()); + LLFontDescriptor new_desc(mGroupNameBox->getFont()->getFontDesc()); // *NOTE dzaporozhan // On Windows LLFontGL::NORMAL will not remove LLFontGL::BOLD if font |