From 195ac1229639353a34aa62ee93fcc69e9ef885ab Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Tue, 29 May 2007 12:16:31 +0000 Subject: Fix FS#7230 - the second line in a multi-line item could be the selected item git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13512 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/list.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/gui/list.c b/apps/gui/list.c index 466ab2904b..9b4211cd48 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -504,9 +504,16 @@ static void gui_list_select_at_offset(struct gui_list * gui_list, int offset) int nb_lines = gui_list->display->nb_lines; if (SHOW_LIST_TITLE) nb_lines--; - offset *= gui_list->selected_size; - gui_list->selected_item += offset; + + if (gui_list->selected_size > 1) + { + offset *= gui_list->selected_size; + /* always select the first item of multi-line lists */ + offset -= offset%gui_list->selected_size; + } + gui_list->selected_item += offset; + if (offset < 0) /* moving up the list */ { if (gui_list->selected_item < 0) -- cgit v1.2.3