summaryrefslogtreecommitdiff
path: root/indra/llui/llscrolllistcell.cpp
diff options
context:
space:
mode:
authorVadim Savchuk <vsavchuk@productengine.com>2009-11-12 16:30:02 +0200
committerVadim Savchuk <vsavchuk@productengine.com>2009-11-12 16:30:02 +0200
commite4ad08dcfca251dd954576d8f16a77afcdb2e2b9 (patch)
treed37b04cf5598b4891ff65b0fb97c793810a37120 /indra/llui/llscrolllistcell.cpp
parent047eb379673596bcc3167f399187e2c5f565dbcb (diff)
parent95adfa4cacb68e21b7251882feffbc7cb50b4438 (diff)
Merge from default branch
--HG-- branch : product-engine
Diffstat (limited to 'indra/llui/llscrolllistcell.cpp')
-rw-r--r--indra/llui/llscrolllistcell.cpp22
1 files changed, 19 insertions, 3 deletions
diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp
index a7c268758a..544352176a 100644
--- a/indra/llui/llscrolllistcell.cpp
+++ b/indra/llui/llscrolllistcell.cpp
@@ -71,7 +71,8 @@ LLScrollListCell* LLScrollListCell::create(const LLScrollListCell::Params& cell_
LLScrollListCell::LLScrollListCell(const LLScrollListCell::Params& p)
-: mWidth(p.width)
+: mWidth(p.width),
+ mToolTip(p.tool_tip)
{}
// virtual
@@ -204,13 +205,28 @@ BOOL LLScrollListText::isText() const
return TRUE;
}
+// virtual
+const std::string &LLScrollListText::getToolTip() const
+{
+ // If base class has a tooltip, return that
+ if (! LLScrollListCell::getToolTip().empty())
+ return LLScrollListCell::getToolTip();
+
+ // ...otherwise, return the value itself as the tooltip
+ return mText.getString();
+}
+
+// virtual
BOOL LLScrollListText::needsToolTip() const
{
- // show tooltips for truncated text
+ // If base class has a tooltip, return that
+ if (LLScrollListCell::needsToolTip())
+ return LLScrollListCell::needsToolTip();
+
+ // ...otherwise, show tooltips for truncated text
return mFont->getWidth(mText.getString()) > getWidth();
}
-
//virtual
BOOL LLScrollListText::getVisible() const
{