diff options
author | James Cook <james@lindenlab.com> | 2009-10-03 23:40:28 +0000 |
---|---|---|
committer | James Cook <james@lindenlab.com> | 2009-10-03 23:40:28 +0000 |
commit | ada0f4fa221f2c7070fb02a2b7ff903bdde11c45 (patch) | |
tree | 0ede83511c304110138c01d16da2fff55162ef31 /indra/newview/llnamelistctrl.cpp | |
parent | b1a280841e1823a19658923a8eefeb67d1d70735 (diff) |
Merge inspectors UI project, gooey-4, into viewer-2 trunk. Added new tooltips to 3D avatars, 2D avatar names, and 3D objects. Refactors tooltips and text boxes, line editors, and text editors. Breaks LLExpandableTextBox, but a fix is coming.
Resolved conflicts in lltexteditor.cpp, llchatitemscontainerctrl.cpp, llchatmsgbox.cpp, llfloaterbuycurrency.cpp, llnearbychat.cpp, floater_buy_currency.xml, and ru/strings.xml
Merging revisions 134925-135157 of svn+ssh://svn.lindenlab.com/svn/linden/branches/gooey/gooey-4 into C:\source\viewer-2.0.0-3, respecting ancestry
Diffstat (limited to 'indra/newview/llnamelistctrl.cpp')
-rw-r--r-- | indra/newview/llnamelistctrl.cpp | 60 |
1 files changed, 58 insertions, 2 deletions
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index 8ef6b25c50..541db0ca6e 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -32,16 +32,18 @@ #include "llviewerprecompiledheaders.h" -#include <boost/tokenizer.hpp> - #include "llnamelistctrl.h" +#include <boost/tokenizer.hpp> + #include "llcachename.h" +#include "llfloaterreg.h" #include "llinventory.h" #include "llscrolllistitem.h" #include "llscrolllistcell.h" #include "llscrolllistcolumn.h" #include "llsdparam.h" +#include "lltooltip.h" static LLDefaultChildRegistry::Register<LLNameListCtrl> r("name_list"); @@ -128,6 +130,60 @@ BOOL LLNameListCtrl::handleDragAndDrop( return handled; } +void LLNameListCtrl::showAvatarInspector(const LLUUID& avatar_id) +{ + LLSD key; + key["avatar_id"] = avatar_id; + LLFloaterReg::showInstance("inspect_avatar", key); +} + +//virtual +BOOL LLNameListCtrl::handleToolTip(S32 x, S32 y, MASK mask) +{ + BOOL handled = FALSE; + S32 column_index = getColumnIndexFromOffset(x); + LLScrollListItem* hit_item = hitItem(x, y); + if (hit_item) + { + if (column_index == mNameColumnIndex) + { + // ...this is the column with the avatar name + LLScrollListCell* hit_cell = hit_item->getColumn(column_index); + if (hit_cell) + { + S32 row_index = getItemIndex(hit_item); + LLRect cell_rect = getCellRect(row_index, column_index); + // Convert rect local to screen coordinates + LLRect sticky_rect; + localRectToScreen(cell_rect, &sticky_rect); + + // Spawn at right side of cell + LLCoordGL pos( sticky_rect.mRight - 16, sticky_rect.mTop ); + LLPointer<LLUIImage> icon = LLUI::getUIImage("Info_Small"); + LLUUID avatar_id = hit_item->getValue().asUUID(); + + LLToolTip::Params params; + params.background_visible( false ); + params.click_callback( boost::bind(&LLNameListCtrl::showAvatarInspector, this, avatar_id) ); + params.delay_time(0.0f); // spawn instantly on hover + params.image( icon ); + params.message(""); + params.padding(0); + params.pos(pos); + params.sticky_rect(sticky_rect); + + LLToolTipMgr::getInstance()->show(params); + handled = TRUE; + } + } + } + if (!handled) + { + handled = LLScrollListCtrl::handleToolTip(x, y, mask); + } + return handled; +} + // public void LLNameListCtrl::addGroupNameItem(const LLUUID& group_id, EAddPosition pos, BOOL enabled) |