From 21ff02a69331fbcd53dc93a1af9a93618225b4bf Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Wed, 18 Feb 2015 14:35:00 -0600 Subject: 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 --- gui/fill.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'gui/fill.cpp') diff --git a/gui/fill.cpp b/gui/fill.cpp index 1ddefaa9b..b315cd08a 100644 --- a/gui/fill.cpp +++ b/gui/fill.cpp @@ -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; } -- cgit v1.2.3