From 5983e7fa42ac26cef567b123104570054f5ca72a Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Wed, 30 May 2007 08:29:44 +0000 Subject: few more list anomolys fixed.. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13521 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/list.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/apps/gui/list.c b/apps/gui/list.c index 18b49f64ac..1764ba48eb 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -169,7 +169,15 @@ static void gui_list_put_selection_in_screen(struct gui_list * gui_list, int nb_lines=gui_list->display->nb_lines; if (SHOW_LIST_TITLE) nb_lines--; - if(put_from_end) + if (gui_list->nb_items < nb_lines) + { + gui_list->start_item = 0; + } + else if (gui_list->nb_items - gui_list->selected_item < nb_lines) + { + gui_list->start_item = gui_list->nb_items - nb_lines; + } + else if(put_from_end) { int list_end = gui_list->selected_item + SCROLL_LIMIT; if(list_end >= gui_list->nb_items) @@ -562,6 +570,8 @@ static void gui_list_select_at_offset(struct gui_list * gui_list, int offset) if (gui_list->selected_item - gui_list->start_item >= nb_lines) { gui_list->start_item = gui_list->selected_item; + if (gui_list->nb_items - gui_list->start_item < nb_lines) + gui_list->start_item = gui_list->nb_items - nb_lines; } } else if (nb_lines - (gui_list->selected_item - gui_list->start_item) <= SCROLL_LIMIT) -- cgit v1.2.3