summaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2016-01-18 01:17:38 +0100
committerDees Troy <dees_troy@teamw.in>2016-01-18 16:46:18 +0100
commitdedbb7f78269d6c44dae3d5b4758593d736d4bb2 (patch)
treee6a924df58674b6c9377725db9431467122ca585 /gui
parentDelete leading spaces after word wrapping in console (diff)
downloadandroid_bootable_recovery-dedbb7f78269d6c44dae3d5b4758593d736d4bb2.tar
android_bootable_recovery-dedbb7f78269d6c44dae3d5b4758593d736d4bb2.tar.gz
android_bootable_recovery-dedbb7f78269d6c44dae3d5b4758593d736d4bb2.tar.bz2
android_bootable_recovery-dedbb7f78269d6c44dae3d5b4758593d736d4bb2.tar.lz
android_bootable_recovery-dedbb7f78269d6c44dae3d5b4758593d736d4bb2.tar.xz
android_bootable_recovery-dedbb7f78269d6c44dae3d5b4758593d736d4bb2.tar.zst
android_bootable_recovery-dedbb7f78269d6c44dae3d5b4758593d736d4bb2.zip
Diffstat (limited to 'gui')
-rw-r--r--gui/listbox.cpp12
-rw-r--r--gui/objects.hpp1
2 files changed, 11 insertions, 2 deletions
diff --git a/gui/listbox.cpp b/gui/listbox.cpp
index eeddff954..b0d2731fe 100644
--- a/gui/listbox.cpp
+++ b/gui/listbox.cpp
@@ -36,7 +36,7 @@ GUIListBox::GUIListBox(xml_node<>* node) : GUIScrollList(node)
xml_node<>* child;
mIconSelected = mIconUnselected = NULL;
mUpdate = 0;
- isCheckList = false;
+ isCheckList = isTextParsed = false;
// Get the icons, if any
child = FindNode(node, "icon");
@@ -87,7 +87,8 @@ GUIListBox::GUIListBox(xml_node<>* node) : GUIScrollList(node)
attr = child->first_attribute("name");
if (!attr)
continue;
- item.displayName = gui_parse_text(attr->value());
+ // We will parse display names when we get page focus to ensure that translating takes place
+ item.displayName = attr->value();
item.variableValue = gui_parse_text(child->value());
item.selected = (child->value() == currentValue);
item.action = NULL;
@@ -191,6 +192,13 @@ void GUIListBox::SetPageFocus(int inFocus)
{
GUIScrollList::SetPageFocus(inFocus);
if (inFocus) {
+ if (!isTextParsed) {
+ isTextParsed = true;
+ for (size_t i = 0; i < mListItems.size(); i++) {
+ ListItem& item = mListItems[i];
+ item.displayName = gui_parse_text(item.displayName);
+ }
+ }
DataManager::GetValue(mVariable, currentValue);
NotifyVarChange(mVariable, currentValue);
}
diff --git a/gui/objects.hpp b/gui/objects.hpp
index 15ad1e6c2..e7ade18a5 100644
--- a/gui/objects.hpp
+++ b/gui/objects.hpp
@@ -652,6 +652,7 @@ protected:
ImageResource* mIconSelected;
ImageResource* mIconUnselected;
bool isCheckList;
+ bool isTextParsed;
};
class GUIPartitionList : public GUIScrollList