From b9a468aff6b4b9bdaf4ac0ab2a309902c6c203ed Mon Sep 17 00:00:00 2001 From: Vladimir Pchelko <pchelko@productengine.com> Date: Wed, 16 Jun 2010 13:53:39 +0300 Subject: [PATCH] EXT-7751 FIXED Sets title text for ToolTip and show ToolTip when title text > text boxsize Reviewed by Vadim Savchuk and Mike Antipov at https://codereview.productengine.com/secondlife/r/576/ --HG-- branch : product-engine --- indra/newview/llinventoryitemslist.cpp | 14 +++++++++++++- indra/newview/llinventoryitemslist.h | 4 ++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp index 23ea786484a..c4efd703853 100644 --- a/indra/newview/llinventoryitemslist.cpp +++ b/indra/newview/llinventoryitemslist.cpp @@ -288,11 +288,23 @@ void LLPanelInventoryListItemBase::setIconImage(const LLUIImagePtr& image) void LLPanelInventoryListItemBase::setTitle(const std::string& title, const std::string& highlit_text) { + setToolTip(title); + LLTextUtil::textboxSetHighlightedVal( mTitleCtrl, LLStyle::Params(), title, - highlit_text); + highlit_text); +} + +BOOL LLPanelInventoryListItemBase::handleToolTip( S32 x, S32 y, MASK mask) +{ + LLTextBox* item_name = getChild<LLTextBox>("item_name"); + if (item_name->getRect().getWidth() < item_name->getTextPixelWidth()) + { + return LLPanel::handleToolTip(x,y,mask); + } + return FALSE; } void LLPanelInventoryListItemBase::reshapeLeftWidgets() diff --git a/indra/newview/llinventoryitemslist.h b/indra/newview/llinventoryitemslist.h index d6132717e86..c24e8b63e07 100644 --- a/indra/newview/llinventoryitemslist.h +++ b/indra/newview/llinventoryitemslist.h @@ -179,6 +179,10 @@ class LLPanelInventoryListItemBase : public LLPanel /** Set item title - inventory item name usually */ virtual void setTitle(const std::string& title, const std::string& highlit_text); + /** + * Show tool tip if item name text size > panel size + */ + virtual BOOL handleToolTip( S32 x, S32 y, MASK mask); LLViewerInventoryItem* mItem; -- GitLab