diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2007-05-29 12:16:31 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2007-05-29 12:16:31 +0000 |
commit | 195ac1229639353a34aa62ee93fcc69e9ef885ab (patch) | |
tree | a8c6a21343bf2e6c1c83ad7d551038933c1c2c1b /apps | |
parent | b2ecf1bc83565602af133a4ab59e98e7813548b3 (diff) |
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
Diffstat (limited to 'apps')
-rw-r--r-- | apps/gui/list.c | 11 |
1 files 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) |