summaryrefslogtreecommitdiffstats
path: root/gui/console.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/console.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/console.cpp35
1 files changed, 8 insertions, 27 deletions
diff --git a/gui/console.cpp b/gui/console.cpp
index 9c780c06b..bb70400c9 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -129,32 +129,15 @@ GUIConsole::GUIConsole(xml_node<>* node) : GUIObject(node)
child = node->first_node("font");
if (child)
{
- attr = child->first_attribute("resource");
- if (attr)
- mFont = PageManager::FindResource(attr->value());
+ mFont = LoadAttrFont(child, "resource");
}
child = node->first_node("color");
if (child)
{
- attr = child->first_attribute("foreground");
- if (attr)
- {
- std::string color = attr->value();
- ConvertStrToColor(color, &mForegroundColor);
- }
- attr = child->first_attribute("background");
- if (attr)
- {
- std::string color = attr->value();
- ConvertStrToColor(color, &mBackgroundColor);
- }
- attr = child->first_attribute("scroll");
- if (attr)
- {
- std::string color = attr->value();
- ConvertStrToColor(color, &mScrollColor);
- }
+ mForegroundColor = LoadAttrColor(child, "foreground", mForegroundColor);
+ mBackgroundColor = LoadAttrColor(child, "background", mBackgroundColor);
+ mScrollColor = LoadAttrColor(child, "scroll", mScrollColor);
}
// Load the placement
@@ -166,21 +149,19 @@ GUIConsole::GUIConsole(xml_node<>* node) : GUIObject(node)
mSlideout = 1;
LoadPlacement(child, &mSlideoutX, &mSlideoutY);
- attr = child->first_attribute("resource");
- if (attr) mSlideoutImage = PageManager::FindResource(attr->value());
+ mSlideoutImage = LoadAttrImage(child, "resource");
if (mSlideoutImage && mSlideoutImage->GetResource())
{
- mSlideoutW = gr_get_width(mSlideoutImage->GetResource());
- mSlideoutH = gr_get_height(mSlideoutImage->GetResource());
+ mSlideoutW = mSlideoutImage->GetWidth();
+ mSlideoutH = mSlideoutImage->GetHeight();
}
}
}
- mFontHeight = gr_getMaxFontHeight(mFont ? mFont->GetResource() : NULL);
+ mFontHeight = mFont->GetHeight();
SetActionPos(mRenderX, mRenderY, mRenderW, mRenderH);
SetRenderPos(mConsoleX, mConsoleY);
- return;
}
int GUIConsole::RenderSlideout(void)