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.cpp59
1 files changed, 42 insertions, 17 deletions
diff --git a/indra/llui/llscrolllistcell.cpp b/indra/llui/llscrolllistcell.cpp
index 7ef2e54429..a3108d77e8 100644
--- a/indra/llui/llscrolllistcell.cpp
+++ b/indra/llui/llscrolllistcell.cpp
@@ -30,6 +30,7 @@
#include "llscrolllistcell.h"
#include "llcheckboxctrl.h"
+#include "llfontvertexbuffer.h"
#include "llui.h" // LLUIImage
#include "lluictrlfactory.h"
@@ -156,7 +157,7 @@ S32 LLScrollListIcon::getWidth() const
}
-void LLScrollListIcon::draw(const LLColor4& color, const LLColor4& highlight_color) const
+void LLScrollListIcon::draw(const LLColor4& color, const LLColor4& highlight_color)
{
if (mIcon)
{
@@ -236,7 +237,7 @@ S32 LLScrollListBar::getWidth() const
}
-void LLScrollListBar::draw(const LLColor4& color, const LLColor4& highlight_color) const
+void LLScrollListBar::draw(const LLColor4& color, const LLColor4& highlight_color)
{
S32 bar_width = getWidth() - mLeftPad - mRightPad;
S32 left = (S32)(bar_width - bar_width * mRatio);
@@ -308,6 +309,19 @@ bool LLScrollListText::needsToolTip() const
return mFont->getWidth(mText.getWString().c_str()) > getWidth();
}
+void LLScrollListText::setTextWidth(S32 value)
+{
+ mTextWidth = value;
+ mFontBuffer.reset();
+}
+
+void LLScrollListText::setWidth(S32 width)
+{
+ LLScrollListCell::setWidth(width);
+ mTextWidth = width;
+ mFontBuffer.reset();
+}
+
//virtual
bool LLScrollListText::getVisible() const
{
@@ -341,6 +355,7 @@ void LLScrollListText::setColor(const LLColor4& color)
void LLScrollListText::setText(const LLStringExplicit& text)
{
mText = text;
+ mFontBuffer.reset();
}
void LLScrollListText::setFontStyle(const U8 font_style)
@@ -348,6 +363,13 @@ void LLScrollListText::setFontStyle(const U8 font_style)
LLFontDescriptor new_desc(mFont->getFontDesc());
new_desc.setStyle(font_style);
mFont = LLFontGL::getFont(new_desc);
+ mFontBuffer.reset();
+}
+
+void LLScrollListText::setAlignment(LLFontGL::HAlign align)
+{
+ mFontAlignment = align;
+ mFontBuffer.reset();
}
//virtual
@@ -375,7 +397,7 @@ const LLSD LLScrollListText::getAltValue() const
}
-void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_color) const
+void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_color)
{
LLColor4 display_color;
if (mUseColor)
@@ -426,17 +448,18 @@ void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_col
start_x = (F32)getWidth() * 0.5f;
break;
}
- mFont->render(mText.getWString(), 0,
- start_x, 0.f,
- display_color,
- mFontAlignment,
- LLFontGL::BOTTOM,
- 0,
- LLFontGL::NO_SHADOW,
- string_chars,
- getTextWidth(),
- &right_x,
- true);
+ mFontBuffer.render(mFont,
+ mText.getWString(), 0,
+ start_x, 0.f,
+ display_color,
+ mFontAlignment,
+ LLFontGL::BOTTOM,
+ 0,
+ LLFontGL::NO_SHADOW,
+ string_chars,
+ getTextWidth(),
+ &right_x,
+ true);
}
//
@@ -475,7 +498,7 @@ LLScrollListCheck::~LLScrollListCheck()
mCheckBox = NULL;
}
-void LLScrollListCheck::draw(const LLColor4& color, const LLColor4& highlight_color) const
+void LLScrollListCheck::draw(const LLColor4& color, const LLColor4& highlight_color)
{
mCheckBox->draw();
}
@@ -592,7 +615,7 @@ void LLScrollListIconText::setWidth(S32 width)
}
-void LLScrollListIconText::draw(const LLColor4& color, const LLColor4& highlight_color) const
+void LLScrollListIconText::draw(const LLColor4& color, const LLColor4& highlight_color)
{
LLColor4 display_color;
if (mUseColor)
@@ -650,7 +673,9 @@ void LLScrollListIconText::draw(const LLColor4& color, const LLColor4& highlight
start_icon_x = (S32)(center - (((F32)icon_space + mFont->getWidth(mText.getWString().c_str())) * 0.5f));
break;
}
- mFont->render(mText.getWString(), 0,
+ mFontBuffer.render(
+ mFont,
+ mText.getWString(), 0,
start_text_x, 0.f,
display_color,
mFontAlignment,