summaryrefslogtreecommitdiff
path: root/indra/llui/llscrolllistcell.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llui/llscrolllistcell.cpp')
-rw-r--r--indra/llui/llscrolllistcell.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp
index a7c268758a..3cc92baa8d 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
@@ -187,7 +188,7 @@ LLScrollListText::LLScrollListText(const LLScrollListCell::Params& p)
// initialize rounded rect image
if (!mRoundedRectImage)
{
- mRoundedRectImage = LLUI::getUIImage("rounded_square.tga");
+ mRoundedRectImage = LLUI::getUIImage("Rounded_Square");
}
}
@@ -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
{
@@ -337,7 +353,7 @@ LLScrollListCheck::LLScrollListCheck(const LLScrollListCell::Params& p)
{
LLCheckBoxCtrl::Params checkbox_p;
checkbox_p.name("checkbox");
- checkbox_p.rect.left(0).bottom(0).width(p.width).height(p.width);
+ checkbox_p.rect = LLRect(0, p.width, p.width, 0);
checkbox_p.enabled(p.enabled);
checkbox_p.initial_value(p.value());