summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVladimir Pchelko <pchelko@productengine.com>2010-06-16 13:53:39 +0300
committerVladimir Pchelko <pchelko@productengine.com>2010-06-16 13:53:39 +0300
commitb9a468aff6b4b9bdaf4ac0ab2a309902c6c203ed (patch)
treedb19f225200e478290e266e511402fd0afcb8ed7
parent46ebc6d37389f6cbc27262ca7d1817a7215d4d9f (diff)
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
-rw-r--r--indra/newview/llinventoryitemslist.cpp14
-rw-r--r--indra/newview/llinventoryitemslist.h4
2 files changed, 17 insertions, 1 deletions
diff --git a/indra/newview/llinventoryitemslist.cpp b/indra/newview/llinventoryitemslist.cpp
index 23ea786484..c4efd70385 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 d6132717e8..c24e8b63e0 100644
--- a/indra/newview/llinventoryitemslist.h
+++ b/indra/newview/llinventoryitemslist.h
@@ -179,6 +179,10 @@ protected:
/** 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;