From 0af779569095af43a2762843f40d2d5e88168bf9 Mon Sep 17 00:00:00 2001 From: that Date: Wed, 25 Feb 2015 08:52:19 +0100 Subject: gui: introduce virtual RenderItem method in ScrollList - so derived lists can draw whatever they want (multi-line etc.) - replace GetListItem with RenderItem - minor cleanup Change-Id: I062e0a354f1c18ce0a5232b7542c4987b480e232 --- gui/partitionlist.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'gui/partitionlist.cpp') diff --git a/gui/partitionlist.cpp b/gui/partitionlist.cpp index ba8a94bb7..102802d7d 100644 --- a/gui/partitionlist.cpp +++ b/gui/partitionlist.cpp @@ -197,14 +197,14 @@ size_t GUIPartitionList::GetItemCount() return mList.size(); } -int GUIPartitionList::GetListItem(size_t item_index, ImageResource*& icon, std::string &text) +void GUIPartitionList::RenderItem(size_t itemindex, int yPos, bool selected) { - text = mList.at(item_index).Display_Name; - 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).Display_Name; + + RenderStdItem(yPos, selected, icon, text.c_str()); } void GUIPartitionList::NotifySelect(size_t item_selected) -- cgit v1.2.3