summaryrefslogtreecommitdiffstats
path: root/gui/input.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/input.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/input.cpp')
-rw-r--r--gui/input.cpp39
1 files changed, 11 insertions, 28 deletions
diff --git a/gui/input.cpp b/gui/input.cpp
index e89333575..299034a2c 100644
--- a/gui/input.cpp
+++ b/gui/input.cpp
@@ -88,35 +88,21 @@ GUIInput::GUIInput(xml_node<>* node)
child = node->first_node("background");
if (child)
{
- attr = child->first_attribute("resource");
- if (attr)
- mBackground = PageManager::FindResource(attr->value());
- attr = child->first_attribute("color");
- if (attr)
- {
- std::string color = attr->value();
- ConvertStrToColor(color, &mBackgroundColor);
- }
+ mBackground = LoadAttrImage(child, "resource");
+ mBackgroundColor = LoadAttrColor(child, "color", mBackgroundColor);
}
if (mBackground && mBackground->GetResource())
{
- mBackgroundW = gr_get_width(mBackground->GetResource());
- mBackgroundH = gr_get_height(mBackground->GetResource());
+ mBackgroundW = mBackground->GetWidth();
+ mBackgroundH = mBackground->GetHeight();
}
// Load the cursor color
child = node->first_node("cursor");
if (child)
{
- attr = child->first_attribute("resource");
- if (attr)
- mCursor = PageManager::FindResource(attr->value());
- attr = child->first_attribute("color");
- if (attr)
- {
- std::string color = attr->value();
- ConvertStrToColor(color, &mCursorColor);
- }
+ mCursor = LoadAttrImage(child, "resource");
+ mCursorColor = LoadAttrColor(child, "color", mCursorColor);
attr = child->first_attribute("hasfocus");
if (attr)
{
@@ -132,15 +118,12 @@ GUIInput::GUIInput(xml_node<>* node)
}
DrawCursor = HasInputFocus;
- // Load the font, and possibly override the color
+ // Load the font
child = node->first_node("font");
if (child)
{
- attr = child->first_attribute("resource");
- if (attr) {
- mFont = PageManager::FindResource(attr->value());
- mFontHeight = gr_getMaxFontHeight(mFont ? mFont->GetResource() : NULL);
- }
+ mFont = LoadAttrFont(child, "resource");
+ mFontHeight = mFont->GetHeight();
}
child = node->first_node("text");
@@ -213,8 +196,8 @@ GUIInput::GUIInput(xml_node<>* node)
GUIInput::~GUIInput()
{
- if (mInputText) delete mInputText;
- if (mAction) delete mAction;
+ delete mInputText;
+ delete mAction;
}
int GUIInput::HandleTextLocation(int x)