aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/llui/llscrolllistctrl.cpp
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:45:30 -0500
committerJacek Antonelli2008-08-15 23:45:30 -0500
commit6fa6022a3f6d5bf71d97a59ec89929575f2ffd11 (patch)
tree3d1f89612dab6f8a8089ccac8cfeb6372f6fad8c /linden/indra/llui/llscrolllistctrl.cpp
parentSecond Life viewer sources 1.19.0.2 (diff)
downloadmeta-impy-6fa6022a3f6d5bf71d97a59ec89929575f2ffd11.zip
meta-impy-6fa6022a3f6d5bf71d97a59ec89929575f2ffd11.tar.gz
meta-impy-6fa6022a3f6d5bf71d97a59ec89929575f2ffd11.tar.bz2
meta-impy-6fa6022a3f6d5bf71d97a59ec89929575f2ffd11.tar.xz
Second Life viewer sources 1.19.0.3
Diffstat (limited to 'linden/indra/llui/llscrolllistctrl.cpp')
-rw-r--r--linden/indra/llui/llscrolllistctrl.cpp30
1 files changed, 9 insertions, 21 deletions
diff --git a/linden/indra/llui/llscrolllistctrl.cpp b/linden/indra/llui/llscrolllistctrl.cpp
index 36a7b00..043caa9 100644
--- a/linden/indra/llui/llscrolllistctrl.cpp
+++ b/linden/indra/llui/llscrolllistctrl.cpp
@@ -220,22 +220,14 @@ LLScrollListText::LLScrollListText( const LLString& text, const LLFontGL* font,
220: LLScrollListCell(width), 220: LLScrollListCell(width),
221 mText( text ), 221 mText( text ),
222 mFont( font ), 222 mFont( font ),
223 mColor(color),
224 mUseColor(use_color),
223 mFontStyle( font_style ), 225 mFontStyle( font_style ),
224 mFontAlignment( font_alignment ), 226 mFontAlignment( font_alignment ),
225 mVisible( visible ), 227 mVisible( visible ),
226 mHighlightCount( 0 ), 228 mHighlightCount( 0 ),
227 mHighlightOffset( 0 ) 229 mHighlightOffset( 0 )
228{ 230{
229 if (use_color)
230 {
231 mColor = new LLColor4();
232 mColor->setVec(color);
233 }
234 else
235 {
236 mColor = NULL;
237 }
238
239 sCount++; 231 sCount++;
240 232
241 // initialize rounded rect image 233 // initialize rounded rect image
@@ -248,7 +240,6 @@ LLScrollListText::LLScrollListText( const LLString& text, const LLFontGL* font,
248LLScrollListText::~LLScrollListText() 240LLScrollListText::~LLScrollListText()
249{ 241{
250 sCount--; 242 sCount--;
251 delete mColor;
252} 243}
253 244
254S32 LLScrollListText::getContentWidth() const 245S32 LLScrollListText::getContentWidth() const
@@ -259,11 +250,8 @@ S32 LLScrollListText::getContentWidth() const
259 250
260void LLScrollListText::setColor(const LLColor4& color) 251void LLScrollListText::setColor(const LLColor4& color)
261{ 252{
262 if (!mColor) 253 mColor = color;
263 { 254 mUseColor = TRUE;
264 mColor = new LLColor4();
265 }
266 *mColor = color;
267} 255}
268 256
269void LLScrollListText::setText(const LLStringExplicit& text) 257void LLScrollListText::setText(const LLStringExplicit& text)
@@ -273,14 +261,14 @@ void LLScrollListText::setText(const LLStringExplicit& text)
273 261
274void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_color) const 262void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_color) const
275{ 263{
276 const LLColor4* display_color; 264 LLColor4 display_color;
277 if (mColor) 265 if (mUseColor)
278 { 266 {
279 display_color = mColor; 267 display_color = mColor;
280 } 268 }
281 else 269 else
282 { 270 {
283 display_color = &color; 271 display_color = color;
284 } 272 }
285 273
286 if (mHighlightCount > 0) 274 if (mHighlightCount > 0)
@@ -327,7 +315,7 @@ void LLScrollListText::draw(const LLColor4& color, const LLColor4& highlight_col
327 } 315 }
328 mFont->render(mText.getWString(), 0, 316 mFont->render(mText.getWString(), 0,
329 start_x, 2.f, 317 start_x, 2.f,
330 *display_color, 318 display_color,
331 mFontAlignment, 319 mFontAlignment,
332 LLFontGL::BOTTOM, 320 LLFontGL::BOTTOM,
333 mFontStyle, 321 mFontStyle,
@@ -1070,7 +1058,7 @@ BOOL LLScrollListCtrl::selectItemRange( S32 first_index, S32 last_index )
1070 { 1058 {
1071 if( itemp->getEnabled() ) 1059 if( itemp->getEnabled() )
1072 { 1060 {
1073 selectItem(itemp); 1061 selectItem(itemp, FALSE);
1074 success = TRUE; 1062 success = TRUE;
1075 if (!success) 1063 if (!success)
1076 mOriginalSelection = first_index; 1064 mOriginalSelection = first_index;