From 5caf36d122defc1dbb95b019651dd7a065b0ac73 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Thu, 29 Dec 2005 00:21:55 +0000 Subject: Patch #1387569 by Stephan Wezel - page-down doesn't select the element before the last element git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8294 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/list.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'apps/gui/list.c') diff --git a/apps/gui/list.c b/apps/gui/list.c index 4e030c0a5f..83a1fbfb22 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -103,7 +103,10 @@ void gui_list_put_selection_in_screen(struct gui_list * gui_list, int nb_lines=gui_list->display->nb_lines; if(put_from_end) { - int list_end = gui_list->selected_item + SCROLL_LIMIT - 1; + int list_end = gui_list->selected_item + SCROLL_LIMIT; + + if(list_end-1 == gui_list->nb_items) + list_end--; if(list_end > gui_list->nb_items) list_end = nb_lines; gui_list->start_item = list_end - nb_lines; -- cgit v1.2.3