diff options
Diffstat (limited to 'indra/newview/llnamelistctrl.cpp')
-rw-r--r-- | indra/newview/llnamelistctrl.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/indra/newview/llnamelistctrl.cpp b/indra/newview/llnamelistctrl.cpp index a47721be9d..9dd37cf47d 100644 --- a/indra/newview/llnamelistctrl.cpp +++ b/indra/newview/llnamelistctrl.cpp @@ -332,9 +332,6 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto BOOL draw_heading = FALSE; node->getAttributeBOOL("draw_heading", draw_heading); - BOOL collapse_empty_columns = FALSE; - node->getAttributeBOOL("collapse_empty_columns", collapse_empty_columns); - S32 name_column_index = 0; node->getAttributeS32("name_column_index", name_column_index); @@ -355,7 +352,6 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto node->getAttributeS32("heading_height", heading_height); name_list->setHeadingHeight(heading_height); } - name_list->setCollapseEmptyColumns(collapse_empty_columns); BOOL allow_calling_card_drop = FALSE; if (node->getAttributeBOOL("allow_calling_card_drop", allow_calling_card_drop)) @@ -369,6 +365,7 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto LLSD columns; S32 index = 0; + S32 total_static = 0; LLXMLNodePtr child; for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) { @@ -380,6 +377,13 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto LLString columnname(labelname); child->getAttributeString("name", columnname); + BOOL columndynamicwidth = FALSE; + child->getAttributeBOOL("dynamicwidth", columndynamicwidth); + + LLString sortname(columnname); + child->getAttributeString("sort", sortname); + + S32 columnwidth = -1; if (child->hasAttribute("relwidth")) { F32 columnrelwidth = 0.f; @@ -388,7 +392,6 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto } else { - S32 columnwidth = -1; child->getAttributeS32("width", columnwidth); columns[index]["width"] = columnwidth; } @@ -396,14 +399,21 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto LLFontGL::HAlign h_align = LLFontGL::LEFT; h_align = LLView::selectFontHAlign(child); + if(!columndynamicwidth) total_static += llmax(0, columnwidth); + columns[index]["name"] = columnname; columns[index]["label"] = labelname; columns[index]["halign"] = (S32)h_align; + columns[index]["dynamicwidth"] = columndynamicwidth; + columns[index]["sort"] = sortname; + index++; } } + name_list->setTotalStaticColumnWidth(total_static); name_list->setColumnHeadings(columns); + for (child = node->getFirstChild(); child.notNull(); child = child->getNextSibling()) { if (child->hasName("row")) @@ -453,7 +463,7 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto while(token_iter != tokens.end()) { const char* line = token_iter->c_str(); - name_list->addSimpleItem(line); + name_list->addCommentText(line); ++token_iter; } |