summaryrefslogtreecommitdiffstats
path: root/gui/button.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/button.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 '')
-rw-r--r--gui/button.cpp19
1 files changed, 6 insertions, 13 deletions
diff --git a/gui/button.cpp b/gui/button.cpp
index 943d71914..6ea0beec9 100644
--- a/gui/button.cpp
+++ b/gui/button.cpp
@@ -98,9 +98,7 @@ GUIButton::GUIButton(xml_node<>* node)
child = node->first_node("icon");
if (child)
{
- attr = child->first_attribute("resource");
- if (attr)
- mButtonIcon = PageManager::FindResource(attr->value());
+ mButtonIcon = LoadAttrImage(child, "resource");
}
memset(&mHighlightColor, 0, sizeof(COLOR));
@@ -122,14 +120,13 @@ GUIButton::GUIButton(xml_node<>* node)
LoadPlacement(node->first_node("placement"), &x, &y, &w, &h, &TextPlacement);
}
SetRenderPos(x, y, w, h);
- return;
}
GUIButton::~GUIButton()
{
- if (mButtonImg) delete mButtonImg;
- if (mButtonLabel) delete mButtonLabel;
- if (mAction) delete mAction;
+ delete mButtonImg;
+ delete mButtonLabel;
+ delete mAction;
}
int GUIButton::Render(void)
@@ -221,12 +218,8 @@ int GUIButton::SetRenderPos(int x, int y, int w, int h)
mRenderH = h;
}
- mIconW = 0; mIconH = 0;
- if (mButtonIcon && mButtonIcon->GetResource())
- {
- mIconW = gr_get_width(mButtonIcon->GetResource());
- mIconH = gr_get_height(mButtonIcon->GetResource());
- }
+ mIconW = mButtonIcon->GetWidth();
+ mIconH = mButtonIcon->GetHeight();
mTextH = 0;
mTextW = 0;