GUI: Support styles in xml to reduce xml file size
Also allow sliders to have their own text label instead of requiring a whole separate text object for the label in the xml. Change-Id: I6e314efb4bb454d496555ff7e003d743063a1308
This commit is contained in:
+4
-12
@@ -27,23 +27,15 @@ extern "C" {
|
||||
|
||||
GUIFill::GUIFill(xml_node<>* node) : GUIObject(node)
|
||||
{
|
||||
xml_attribute<>* attr;
|
||||
xml_node<>* child;
|
||||
|
||||
if (!node)
|
||||
return;
|
||||
|
||||
attr = node->first_attribute("color");
|
||||
if (!attr) {
|
||||
bool has_color = false;
|
||||
mColor = LoadAttrColor(node, "color", &has_color);
|
||||
if (!has_color) {
|
||||
LOGERR("No color specified for fill\n");
|
||||
return;
|
||||
}
|
||||
|
||||
std::string color = attr->value();
|
||||
ConvertStrToColor(color, &mColor);
|
||||
|
||||
// Load the placement
|
||||
LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY, &mRenderW, &mRenderH);
|
||||
LoadPlacement(FindNode(node, "placement"), &mRenderX, &mRenderY, &mRenderW, &mRenderH);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user