Fix internal issue of column headers not displaying tooltips

This commit is contained in:
Lirusaito
2013-07-16 00:52:59 -04:00
parent cee9e976b1
commit 9b92b51b2c
3 changed files with 18 additions and 2 deletions

View File

@@ -95,6 +95,22 @@ void LLScrollColumnHeader::draw()
LLButton::draw();
}
//virtual
BOOL LLScrollColumnHeader::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen)
{
std::string tool_tip = LLUI::sShowXUINames ? getShowNamesToolTip() : getToolTip();
if (tool_tip.empty()) tool_tip = getLabelUnselected(); // Fallback on label
if (!tool_tip.empty())
{
msg = tool_tip;
// Convert rect local to screen coordinates
localPointToScreen(0, 0, &(sticky_rect_screen->mLeft), &(sticky_rect_screen->mBottom));
localPointToScreen(getRect().getWidth(), getRect().getHeight(), &(sticky_rect_screen->mRight), &(sticky_rect_screen->mTop));
}
return !tool_tip.empty();
}
BOOL LLScrollColumnHeader::handleDoubleClick(S32 x, S32 y, MASK mask)
{
if (canResize() && mResizeBar->getRect().pointInRect(x, y))

View File

@@ -43,6 +43,7 @@ public:
~LLScrollColumnHeader();
/*virtual*/ void draw();
/*virtual*/ BOOL handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sticky_rect_screen);
/*virtual*/ BOOL handleDoubleClick(S32 x, S32 y, MASK mask);
/*virtual*/ LLView* findSnapEdge(S32& new_edge_val, const LLCoordGL& mouse_dir, ESnapEdge snap_edge, ESnapType snap_type, S32 threshold, S32 padding);

View File

@@ -1612,8 +1612,7 @@ BOOL LLScrollListCtrl::handleToolTip(S32 x, S32 y, std::string& msg, LLRect* sti
LLScrollColumnHeader* headerp = columnp->mHeader;
if (headerp && !handled)
{
headerp->handleToolTip(x, y, msg, sticky_rect_screen);
handled = !msg.empty();
handled = headerp->handleToolTip(x, y, msg, sticky_rect_screen);
}
return handled;