Updated gesture floater to use more modern (and actual working) method of adding list elements via xml.
This commit is contained in:
@@ -3224,16 +3224,20 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
|
||||
|
||||
for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling())
|
||||
{
|
||||
if (child->hasName("row"))
|
||||
if (child->hasName("row") || child->hasName("rows"))
|
||||
{
|
||||
LLUUID id;
|
||||
child->getAttributeUUID("id", id);
|
||||
|
||||
LLSD row;
|
||||
|
||||
row["id"] = id;
|
||||
std::string value;
|
||||
child->getAttributeString("value",value);
|
||||
bool id_found = child->getAttributeUUID("id", id);
|
||||
if(id_found)
|
||||
row["id"] = id;
|
||||
else
|
||||
row["id"] = value;
|
||||
|
||||
S32 column_idx = 0;
|
||||
bool explicit_column = false;
|
||||
LLXMLNodePtr row_child;
|
||||
for (row_child = child->getFirstChild(); row_child.notNull(); row_child = row_child->getNextSibling())
|
||||
{
|
||||
@@ -3255,15 +3259,24 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
|
||||
row["columns"][column_idx]["font"] = font;
|
||||
row["columns"][column_idx]["font-style"] = font_style;
|
||||
column_idx++;
|
||||
explicit_column = true;
|
||||
}
|
||||
}
|
||||
scroll_list->addElement(row);
|
||||
if(explicit_column)
|
||||
scroll_list->addElement(row);
|
||||
else
|
||||
{
|
||||
LLSD entry_id;
|
||||
if(id_found)
|
||||
entry_id = id;
|
||||
scroll_list->addSimpleElement(value,ADD_BOTTOM,entry_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string contents = node->getTextContents();
|
||||
scroll_list->setCommentText(contents);
|
||||
|
||||
|
||||
return scroll_list;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user