diff options
author | Ethan Yonker <dees_troy@teamw.in> | 2015-02-18 21:35:00 +0100 |
---|---|---|
committer | Ethan Yonker <dees_troy@teamw.in> | 2015-02-21 15:14:24 +0100 |
commit | 21ff02a69331fbcd53dc93a1af9a93618225b4bf (patch) | |
tree | 623fe5a07a506362b91a16b34d62a875b3d45c32 /gui/slidervalue.cpp | |
parent | gui: make kinetic scrolling deceleration more awesome (diff) | |
download | android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.gz android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.bz2 android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.lz android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.xz android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.tar.zst android_bootable_recovery-21ff02a69331fbcd53dc93a1af9a93618225b4bf.zip |
Diffstat (limited to 'gui/slidervalue.cpp')
-rw-r--r-- | gui/slidervalue.cpp | 53 |
1 files changed, 12 insertions, 41 deletions
diff --git a/gui/slidervalue.cpp b/gui/slidervalue.cpp index 5be58dcf3..3974c37d0 100644 --- a/gui/slidervalue.cpp +++ b/gui/slidervalue.cpp @@ -70,7 +70,7 @@ GUISliderValue::GUISliderValue(xml_node<>* node) : GUIObject(node) mAction = new GUIAction(node); - child = node->first_node("font"); + child = FindNode(node, "font"); if (child) { mFont = LoadAttrFont(child, "resource"); @@ -78,21 +78,16 @@ GUISliderValue::GUISliderValue(xml_node<>* node) : GUIObject(node) } // Load the placement - LoadPlacement(node->first_node("placement"), &mRenderX, &mRenderY, &mRenderW); + LoadPlacement(FindNode(node, "placement"), &mRenderX, &mRenderY, &mRenderW); - child = node->first_node("colors"); + child = FindNode(node, "colors"); if (child) { - attr = child->first_attribute("line"); - if (attr) - ConvertStrToColor(attr->value(), &mLineColor); - - attr = child->first_attribute("slider"); - if (attr) - ConvertStrToColor(attr->value(), &mSliderColor); + mLineColor = LoadAttrColor(child, "line"); + mSliderColor = LoadAttrColor(child, "slider"); } - child = node->first_node("resource"); + child = FindNode(node, "resource"); if (child) { mBackgroundImage = LoadAttrImage(child, "background"); @@ -100,7 +95,7 @@ GUISliderValue::GUISliderValue(xml_node<>* node) : GUIObject(node) mHandleHoverImage = LoadAttrImage(child, "handlehover"); } - child = node->first_node("data"); + child = FindNode(node, "data"); if (child) { attr = child->first_attribute("variable"); @@ -150,37 +145,13 @@ GUISliderValue::GUISliderValue(xml_node<>* node) : GUIObject(node) mChangeOnDrag = atoi(attr->value()); } - child = node->first_node("dimensions"); + child = FindNode(node, "dimensions"); if (child) { - attr = child->first_attribute("lineh"); - if (attr) - { - string parsevalue = gui_parse_text(attr->value()); - mLineH = scale_theme_y(atoi(parsevalue.c_str())); - } - - attr = child->first_attribute("linepadding"); - if (attr) - { - string parsevalue = gui_parse_text(attr->value()); - mPadding = scale_theme_x(atoi(parsevalue.c_str())); - mLinePadding = mPadding; - } - - attr = child->first_attribute("sliderw"); - if (attr) - { - string parsevalue = gui_parse_text(attr->value()); - mSliderW = scale_theme_x(atoi(parsevalue.c_str())); - } - - attr = child->first_attribute("sliderh"); - if (attr) - { - string parsevalue = gui_parse_text(attr->value()); - mSliderH = scale_theme_y(atoi(parsevalue.c_str())); - } + mLineH = LoadAttrIntScaleY(child, "lineh", mLineH); + mLinePadding = LoadAttrIntScaleX(child, "linepadding", mLinePadding); + mSliderW = LoadAttrIntScaleX(child, "sliderw", mSliderW); + mSliderH = LoadAttrIntScaleY(child, "sliderh", mSliderH); } mFontHeight = mFont->GetHeight(); |