Skip to content
Snippets Groups Projects
Commit b9a468af authored by Vladimir Pchelko's avatar Vladimir Pchelko
Browse files

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
parent 46ebc6d3
No related branches found
No related tags found
No related merge requests found
...@@ -288,6 +288,8 @@ void LLPanelInventoryListItemBase::setIconImage(const LLUIImagePtr& image) ...@@ -288,6 +288,8 @@ void LLPanelInventoryListItemBase::setIconImage(const LLUIImagePtr& image)
void LLPanelInventoryListItemBase::setTitle(const std::string& title, const std::string& highlit_text) void LLPanelInventoryListItemBase::setTitle(const std::string& title, const std::string& highlit_text)
{ {
setToolTip(title);
LLTextUtil::textboxSetHighlightedVal( LLTextUtil::textboxSetHighlightedVal(
mTitleCtrl, mTitleCtrl,
LLStyle::Params(), LLStyle::Params(),
...@@ -295,6 +297,16 @@ void LLPanelInventoryListItemBase::setTitle(const std::string& title, const std: ...@@ -295,6 +297,16 @@ void LLPanelInventoryListItemBase::setTitle(const std::string& title, const std:
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() void LLPanelInventoryListItemBase::reshapeLeftWidgets()
{ {
S32 widget_left = 0; S32 widget_left = 0;
......
...@@ -179,6 +179,10 @@ class LLPanelInventoryListItemBase : public LLPanel ...@@ -179,6 +179,10 @@ class LLPanelInventoryListItemBase : public LLPanel
/** Set item title - inventory item name usually */ /** Set item title - inventory item name usually */
virtual void setTitle(const std::string& title, const std::string& highlit_text); 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; LLViewerInventoryItem* mItem;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment