Touchups to scroll list building
Moved handling of mouse_wheel_opaque and menu_file to setScrollListParameters Removed setToolTip block from LLScrollListCtrl::fromXML since setToolTip lives inside of LLView::initFromXML which is called by LLUICtrl::initFromXML which was already called at this point Added support for building columns from xml with relative_width which is synonymous with relwidth Fixed namelist columns not supporting dynamic_width in xml (dynamicwidth is only acceptable in older xmls)
This commit is contained in:
@@ -2545,6 +2545,19 @@ void LLScrollListCtrl::setScrollListParameters(LLXMLNodePtr node)
|
|||||||
node->getAttributeS32("column_padding", column_padding);
|
node->getAttributeS32("column_padding", column_padding);
|
||||||
setColumnPadding(column_padding);
|
setColumnPadding(column_padding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (node->hasAttribute("mouse_wheel_opaque"))
|
||||||
|
{
|
||||||
|
node->getAttribute_bool("mouse_wheel_opaque", mMouseWheelOpaque);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (node->hasAttribute("menu_file"))
|
||||||
|
{
|
||||||
|
std::string menu_file;
|
||||||
|
node->getAttributeString("menu_file", menu_file);
|
||||||
|
mPopupMenu = LLUICtrlFactory::getInstance()->buildMenu(menu_file, LLMenuGL::sMenuContainer);
|
||||||
|
LLMenuGL::sMenuContainer->addChild(mPopupMenu);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// static
|
// static
|
||||||
@@ -2579,22 +2592,6 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
|
|||||||
scroll_list->initFromXML(node, parent);
|
scroll_list->initFromXML(node, parent);
|
||||||
scroll_list->setSearchColumn(search_column);
|
scroll_list->setSearchColumn(search_column);
|
||||||
|
|
||||||
BOOL mouse_wheel_opaque = true;
|
|
||||||
node->getAttributeBOOL("mouse_wheel_opaque", mouse_wheel_opaque);
|
|
||||||
scroll_list->mMouseWheelOpaque = mouse_wheel_opaque;
|
|
||||||
|
|
||||||
std::string tool_tip;
|
|
||||||
node->getAttributeString("tool_tip", tool_tip);
|
|
||||||
scroll_list->setToolTip(tool_tip);
|
|
||||||
|
|
||||||
std::string menu_file;
|
|
||||||
if (node->getAttributeString("menu_file", menu_file))
|
|
||||||
{
|
|
||||||
LLMenuGL* menu = LLUICtrlFactory::getInstance()->buildMenu(menu_file, LLMenuGL::sMenuContainer);
|
|
||||||
LLMenuGL::sMenuContainer->addChild(menu);
|
|
||||||
scroll_list->setContextMenu(menu);
|
|
||||||
}
|
|
||||||
|
|
||||||
LLSD columns;
|
LLSD columns;
|
||||||
S32 index = 0;
|
S32 index = 0;
|
||||||
for (LLXMLNodePtr child = node->getFirstChild(); child.notNull(); child = child->getNextSibling())
|
for (LLXMLNodePtr child = node->getFirstChild(); child.notNull(); child = child->getNextSibling())
|
||||||
@@ -2634,8 +2631,9 @@ LLView* LLScrollListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFac
|
|||||||
columns[index]["width"] = columnwidth;
|
columns[index]["width"] = columnwidth;
|
||||||
|
|
||||||
F32 columnrelwidth = 0.f;
|
F32 columnrelwidth = 0.f;
|
||||||
if (child->getAttributeF32("relwidth", columnrelwidth))
|
if (child->getAttributeF32("relative_width", columnrelwidth)
|
||||||
columns[index]["relwidth"] = columnrelwidth;
|
|| child->getAttributeF32("relwidth", columnrelwidth))
|
||||||
|
columns[index]["relative_width"] = columnrelwidth;
|
||||||
|
|
||||||
BOOL columndynamicwidth = false;
|
BOOL columndynamicwidth = false;
|
||||||
if (child->getAttributeBOOL("dynamic_width", columndynamicwidth)
|
if (child->getAttributeBOOL("dynamic_width", columndynamicwidth)
|
||||||
|
|||||||
@@ -360,11 +360,23 @@ LLView* LLNameListCtrl::fromXML(LLXMLNodePtr node, LLView *parent, LLUICtrlFacto
|
|||||||
std::string sortname(columnname);
|
std::string sortname(columnname);
|
||||||
child->getAttributeString("sort", sortname);
|
child->getAttributeString("sort", sortname);
|
||||||
|
|
||||||
if (child->hasAttribute("relwidth"))
|
if (child->hasAttribute("relative_width"))
|
||||||
|
{
|
||||||
|
F32 columnrelwidth = 0.f;
|
||||||
|
child->getAttributeF32("relative_width", columnrelwidth);
|
||||||
|
columns[index]["relative_width"] = columnrelwidth;
|
||||||
|
}
|
||||||
|
else if (child->hasAttribute("relwidth"))
|
||||||
{
|
{
|
||||||
F32 columnrelwidth = 0.f;
|
F32 columnrelwidth = 0.f;
|
||||||
child->getAttributeF32("relwidth", columnrelwidth);
|
child->getAttributeF32("relwidth", columnrelwidth);
|
||||||
columns[index]["relwidth"] = columnrelwidth;
|
columns[index]["relative_width"] = columnrelwidth;
|
||||||
|
}
|
||||||
|
else if (child->hasAttribute("dynamic_width"))
|
||||||
|
{
|
||||||
|
BOOL columndynamicwidth = FALSE;
|
||||||
|
child->getAttributeBOOL("dynamic_width", columndynamicwidth);
|
||||||
|
columns[index]["dynamic_width"] = columndynamicwidth;
|
||||||
}
|
}
|
||||||
else if (child->hasAttribute("dynamicwidth"))
|
else if (child->hasAttribute("dynamicwidth"))
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user