summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-06-01 13:37:33 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-06-01 13:37:33 +0000
commit995b71a51d3cfa37ebf5dd40d83bd6c0aed019d4 (patch)
tree47bca6b18995f95e7ac6c1532bceb6be953d12f9 /apps
parentd56016adddbb178307a7787978f5e9dcc30a9652 (diff)
downloadrockbox-995b71a51d3cfa37ebf5dd40d83bd6c0aed019d4.tar.gz
rockbox-995b71a51d3cfa37ebf5dd40d83bd6c0aed019d4.tar.bz2
rockbox-995b71a51d3cfa37ebf5dd40d83bd6c0aed019d4.zip
Some more touchscreen gui list improvements.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17672 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/gui/bitmap/list.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index fa41daeb01..f1dbf188ab 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -311,12 +311,13 @@ unsigned gui_synclist_do_touchpad(struct gui_synclist * gui_list, struct viewpor
if (nb_lines < gui_list->nb_items)
{
height = nb_lines * font_get(parent->font)->height;
- size = height*nb_lines / gui_list->nb_items;
+ size = height / gui_list->nb_items;
new_selection = ((y-list_text[SCREEN_MAIN].y)*(gui_list->nb_items-nb_lines))/(height-size);
- nb_lines /= 2;
- if (new_selection - gui_list->start_item[SCREEN_MAIN] > nb_lines)
- new_selection = gui_list->start_item[SCREEN_MAIN]+nb_lines;
+ if (new_selection - gui_list->start_item[SCREEN_MAIN] > (nb_lines/2))
+ new_selection = gui_list->start_item[SCREEN_MAIN]+(nb_lines/2);
+ else if (new_selection > gui_list->nb_items-nb_lines)
+ new_selection = gui_list->nb_items-nb_lines;
gui_synclist_select_item(gui_list, new_selection);
gui_list->start_item[SCREEN_MAIN] = new_selection;
@@ -337,7 +338,10 @@ unsigned gui_synclist_do_touchpad(struct gui_synclist * gui_list, struct viewpor
for(i=0; i<gui_list->nb_items; i++)
{
if(actual_y > line_height*i && actual_y < line_height*(i+1))
+ {
line = i;
+ break;
+ }
}
if(line == -1)
return ACTION_NONE;