本文整理汇总了C++中LLScrollListCell::setColor方法的典型用法代码示例。如果您正苦于以下问题:C++ LLScrollListCell::setColor方法的具体用法?C++ LLScrollListCell::setColor怎么用?C++ LLScrollListCell::setColor使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类LLScrollListCell
的用法示例。
在下文中一共展示了LLScrollListCell::setColor方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateListItem
//.........这里部分代码省略.........
if(cell)
{
S32 old_visibility = cell->getValue();
// *HACK ALERT: force ordering of Media before Audio before the rest of the list
S32 new_visibility =
item->getUUID() == PARCEL_MEDIA_LIST_ITEM_UUID ? 3
: item->getUUID() == PARCEL_AUDIO_LIST_ITEM_UUID ? 2
: (has_media) ? 1
: ((is_disabled) ? 0
: -1);
cell->setValue(STRINGIZE(new_visibility));
if (new_visibility != old_visibility)
{
mMediaList->setNeedsSort(true);
}
}
cell = item->getColumn(NAME_COLUMN);
if(cell)
{
std::string name = item_name;
std::string old_name = cell->getValue().asString();
if (has_media)
{
name += " " + mPlayingString;
}
if (name != old_name)
{
cell->setValue(name);
}
cell->setToolTip(item_tooltip);
// *TODO: Make these font styles/colors configurable via XUI
U8 font_style = LLFontGL::NORMAL;
LLColor4 cell_color = LLUI::sColorsGroup->getColor("DefaultListText");
// Only colorize by class in debug
if (mDebugInfoVisible)
{
switch (media_class) {
case MEDIA_CLASS_FOCUSED:
cell_color = LLColor4::yellow;
break;
case MEDIA_CLASS_ON_OTHERS:
cell_color = LLColor4::red;
break;
case MEDIA_CLASS_OUTSIDE_PARCEL:
cell_color = LLColor4::orange;
break;
case MEDIA_CLASS_WITHIN_PARCEL:
default:
break;
}
}
if (is_disabled)
{
if (mDebugInfoVisible)
{
font_style |= LLFontGL::ITALIC;
cell_color = LLUI::sColorsGroup->getColor("DefaultListText");
}
else {
// Dim it if it is disabled
cell_color.setAlpha(0.25);
}
}
// Dim it if it isn't "showing"
else if (!has_media)
{
cell_color.setAlpha(0.25);
}
// Bold it if it is time-based media and it is playing
else if (is_time_based_and_playing)
{
if (mDebugInfoVisible) font_style |= LLFontGL::BOLD;
}
cell->setColor(cell_color);
LLScrollListText *text_cell = dynamic_cast<LLScrollListText*> (cell);
if (text_cell)
{
text_cell->setFontStyle(font_style);
}
}
cell = item->getColumn(CLASS_COLUMN);
if(cell)
{
// TODO: clean this up!
cell->setValue(STRINGIZE(media_class));
}
if(mDebugInfoVisible)
{
cell = item->getColumn(DEBUG_COLUMN);
if(cell)
{
cell->setValue(debug_str);
}
}
}