1
0
Fork 0
forked from len0rd/rockbox

1) Implement generic touchscreen detection library for the plugins

2) Adapt minesweeper, pegbox & calculator to it
3) Simplify gui/bitmap/list.c


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17695 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Maurus Cuelenaere 2008-06-06 18:29:46 +00:00
parent f9bf137b67
commit e1753de41a
7 changed files with 382 additions and 12 deletions

View file

@ -344,20 +344,12 @@ unsigned gui_synclist_do_touchpad(struct gui_synclist * gui_list, struct viewpor
if (y > list_text[SCREEN_MAIN].y)
{
int i, line_height, actual_y;
actual_y = y - list_text[SCREEN_MAIN].y;
line_height = font_get(parent->font)->height;
line = -1;
for(i=0; i<gui_list->nb_items; i++)
{
if(actual_y > line_height*i && actual_y < line_height*(i+1))
{
line = i;
break;
}
}
line = actual_y / line_height;
/* Something went wrong during line detection... */
if(line == -1)
if(actual_y%line_height == 0) /* Pressed a border */
return ACTION_NONE;
if (line != gui_list->selected_item - gui_list->start_item[SCREEN_MAIN] && button ^ BUTTON_REL)