summaryrefslogtreecommitdiffstats
path: root/gui/listbox.cpp
diff options
context:
space:
mode:
authorthat <github@that.at>2015-02-25 08:52:19 +0100
committerDees Troy <dees_troy@teamw.in>2015-03-05 04:46:10 +0100
commit0af779569095af43a2762843f40d2d5e88168bf9 (patch)
tree6fb324919992edc103f441303098ce1dedef03f9 /gui/listbox.cpp
parentminuitwrp: fix crash issue, when the console use TTF font to display unicode font. (diff)
downloadandroid_bootable_recovery-0af779569095af43a2762843f40d2d5e88168bf9.tar
android_bootable_recovery-0af779569095af43a2762843f40d2d5e88168bf9.tar.gz
android_bootable_recovery-0af779569095af43a2762843f40d2d5e88168bf9.tar.bz2
android_bootable_recovery-0af779569095af43a2762843f40d2d5e88168bf9.tar.lz
android_bootable_recovery-0af779569095af43a2762843f40d2d5e88168bf9.tar.xz
android_bootable_recovery-0af779569095af43a2762843f40d2d5e88168bf9.tar.zst
android_bootable_recovery-0af779569095af43a2762843f40d2d5e88168bf9.zip
Diffstat (limited to 'gui/listbox.cpp')
-rw-r--r--gui/listbox.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/gui/listbox.cpp b/gui/listbox.cpp
index 625b4b7d1..a60769979 100644
--- a/gui/listbox.cpp
+++ b/gui/listbox.cpp
@@ -141,14 +141,14 @@ size_t GUIListBox::GetItemCount()
return mList.size();
}
-int GUIListBox::GetListItem(size_t item_index, ImageResource*& icon, std::string &text)
+void GUIListBox::RenderItem(size_t itemindex, int yPos, bool selected)
{
- text = mList.at(item_index).displayName;
- if (mList.at(item_index).selected)
- icon = mIconSelected;
- else
- icon = mIconUnselected;
- return 0;
+ // note: the "selected" parameter above is for the currently touched item
+ // don't confuse it with the more persistent "selected" flag per list item used below
+ ImageResource* icon = mList.at(itemindex).selected ? mIconSelected : mIconUnselected;
+ const std::string& text = mList.at(itemindex).displayName;
+
+ RenderStdItem(yPos, selected, icon, text.c_str());
}
void GUIListBox::NotifySelect(size_t item_selected)