summaryrefslogtreecommitdiffstats
path: root/gui/text.cpp
diff options
context:
space:
mode:
authorDees_Troy <dees_troy@teamw.in>2012-10-19 19:13:15 +0200
committerDees_Troy <dees_troy@teamw.in>2012-10-19 19:13:15 +0200
commit4d12f969b8fa40497b60a6e15873b1b3af924dda (patch)
tree103d138e3d4a1a6e23dd7f44a28bb8efdef73bb4 /gui/text.cpp
parentInitial BML support (ext4 only) (diff)
downloadandroid_bootable_recovery-4d12f969b8fa40497b60a6e15873b1b3af924dda.tar
android_bootable_recovery-4d12f969b8fa40497b60a6e15873b1b3af924dda.tar.gz
android_bootable_recovery-4d12f969b8fa40497b60a6e15873b1b3af924dda.tar.bz2
android_bootable_recovery-4d12f969b8fa40497b60a6e15873b1b3af924dda.tar.lz
android_bootable_recovery-4d12f969b8fa40497b60a6e15873b1b3af924dda.tar.xz
android_bootable_recovery-4d12f969b8fa40497b60a6e15873b1b3af924dda.tar.zst
android_bootable_recovery-4d12f969b8fa40497b60a6e15873b1b3af924dda.zip
Diffstat (limited to 'gui/text.cpp')
-rw-r--r--gui/text.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/gui/text.cpp b/gui/text.cpp
index 90482fef3..dc7a2d119 100644
--- a/gui/text.cpp
+++ b/gui/text.cpp
@@ -38,12 +38,16 @@ GUIText::GUIText(xml_node<>* node)
mFontHeight = 0;
maxWidth = 0;
charSkip = 0;
+ isHighlighted = false;
+ hasHighlightColor = false;
if (!node) return;
// Initialize color to solid black
memset(&mColor, 0, sizeof(COLOR));
mColor.alpha = 255;
+ memset(&mHighlightColor, 0, sizeof(COLOR));
+ mHighlightColor.alpha = 255;
attr = node->first_attribute("color");
if (attr)
@@ -51,6 +55,13 @@ GUIText::GUIText(xml_node<>* node)
std::string color = attr->value();
ConvertStrToColor(color, &mColor);
}
+ attr = node->first_attribute("highlightcolor");
+ if (attr)
+ {
+ std::string color = attr->value();
+ ConvertStrToColor(color, &mHighlightColor);
+ hasHighlightColor = true;
+ }
// Load the font, and possibly override the color
child = node->first_node("font");
@@ -66,6 +77,14 @@ GUIText::GUIText(xml_node<>* node)
std::string color = attr->value();
ConvertStrToColor(color, &mColor);
}
+
+ attr = child->first_attribute("highlightcolor");
+ if (attr)
+ {
+ std::string color = attr->value();
+ ConvertStrToColor(color, &mHighlightColor);
+ hasHighlightColor = true;
+ }
}
// Load the placement
@@ -117,7 +136,10 @@ int GUIText::Render(void)
y -= mFontHeight;
}
- gr_color(mColor.red, mColor.green, mColor.blue, mColor.alpha);
+ if (hasHighlightColor && isHighlighted)
+ gr_color(mHighlightColor.red, mHighlightColor.green, mHighlightColor.blue, mHighlightColor.alpha);
+ else
+ gr_color(mColor.red, mColor.green, mColor.blue, mColor.alpha);
if (maxWidth)
gr_textExW(x, y, displayValue.c_str(), fontResource, maxWidth + x);