summaryrefslogtreecommitdiffstats
path: root/gui/progressbar.cpp
diff options
context:
space:
mode:
authorthat <github@that.at>2015-02-14 20:23:16 +0100
committerthat <github@that.at>2015-02-15 20:36:40 +0100
commitf6ed8fc1f51e368bb76905d9f1d2d3735e70a644 (patch)
treeba66418d418869274d259ce35cca8d4021d8ce4e /gui/progressbar.cpp
parentRetain and display previous selection for image flashing (diff)
downloadandroid_bootable_recovery-f6ed8fc1f51e368bb76905d9f1d2d3735e70a644.tar
android_bootable_recovery-f6ed8fc1f51e368bb76905d9f1d2d3735e70a644.tar.gz
android_bootable_recovery-f6ed8fc1f51e368bb76905d9f1d2d3735e70a644.tar.bz2
android_bootable_recovery-f6ed8fc1f51e368bb76905d9f1d2d3735e70a644.tar.lz
android_bootable_recovery-f6ed8fc1f51e368bb76905d9f1d2d3735e70a644.tar.xz
android_bootable_recovery-f6ed8fc1f51e368bb76905d9f1d2d3735e70a644.tar.zst
android_bootable_recovery-f6ed8fc1f51e368bb76905d9f1d2d3735e70a644.zip
Diffstat (limited to 'gui/progressbar.cpp')
-rw-r--r--gui/progressbar.cpp29
1 files changed, 7 insertions, 22 deletions
diff --git a/gui/progressbar.cpp b/gui/progressbar.cpp
index a4d132932..a49e0abb2 100644
--- a/gui/progressbar.cpp
+++ b/gui/progressbar.cpp
@@ -45,13 +45,8 @@ GUIProgressBar::GUIProgressBar(xml_node<>* node) : GUIObject(node)
child = node->first_node("resource");
if (child)
{
- attr = child->first_attribute("empty");
- if (attr)
- mEmptyBar = PageManager::FindResource(attr->value());
-
- attr = child->first_attribute("full");
- if (attr)
- mFullBar = PageManager::FindResource(attr->value());
+ mEmptyBar = LoadAttrImage(child, "empty");
+ mFullBar = LoadAttrImage(child, "full");
}
// Load the placement
@@ -61,23 +56,13 @@ GUIProgressBar::GUIProgressBar(xml_node<>* node) : GUIObject(node)
child = node->first_node("data");
if (child)
{
- attr = child->first_attribute("min");
- if (attr) mMinValVar = attr->value();
-
- attr = child->first_attribute("max");
- if (attr) mMaxValVar = attr->value();
-
- attr = child->first_attribute("name");
- if (attr) mCurValVar = attr->value();
- }
-
- if (mEmptyBar && mEmptyBar->GetResource())
- {
- mRenderW = gr_get_width(mEmptyBar->GetResource());
- mRenderH = gr_get_height(mEmptyBar->GetResource());
+ mMinValVar = LoadAttrString(child, "min");
+ mMaxValVar = LoadAttrString(child, "max");
+ mCurValVar = LoadAttrString(child, "name");
}
- return;
+ mRenderW = mEmptyBar->GetWidth();
+ mRenderH = mEmptyBar->GetHeight();
}
int GUIProgressBar::Render(void)