From 451ee947d6b28beb28e0bde67b19266aea251825 Mon Sep 17 00:00:00 2001 From: Vladimir Pchelko Date: Thu, 17 Jun 2010 21:30:22 +0300 Subject: EXT-7751 FIXED Show tooltip condition was updated Fix descrition: Show tooltip, for long-named items (title text size > text box size) when mouse over text box rectangle. Reviewed by Mike Antipov at https://codereview.productengine.com/secondlife/r/576/ --HG-- branch : product-engine --- indra/newview/llinventoryitemslist.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index f7a07b260b..14de5442d6 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -291,7 +291,7 @@ void LLPanelInventoryListItemBase::setTitle(const std::string& title, const std::string& highlit_text, const LLStyle::Params& input_params) { - setToolTip(title); + mTitleCtrl->setToolTip(title); LLTextUtil::textboxSetHighlightedVal( mTitleCtrl, @@ -302,12 +302,13 @@ void LLPanelInventoryListItemBase::setTitle(const std::string& title, BOOL LLPanelInventoryListItemBase::handleToolTip( S32 x, S32 y, MASK mask) { - LLTextBox* item_name = getChild("item_name"); - if (item_name->getRect().getWidth() < item_name->getTextPixelWidth()) + LLRect text_box_rect = mTitleCtrl->getRect(); + if (text_box_rect.pointInRect(x, y) && + mTitleCtrl->getTextPixelWidth() <= text_box_rect.getWidth()) { - return LLPanel::handleToolTip(x,y,mask); + return FALSE; } - return FALSE; + return LLPanel::handleToolTip(x, y, mask); } void LLPanelInventoryListItemBase::reshapeLeftWidgets() -- cgit v1.2.3