summaryrefslogtreecommitdiffstats
path: root/apps/gui/bitmap/list.c
diff options
context:
space:
mode:
authorMaurus Cuelenaere <mcuelenaere@gmail.com>2008-06-06 18:29:46 +0000
committerMaurus Cuelenaere <mcuelenaere@gmail.com>2008-06-06 18:29:46 +0000
commite1753de41af9149b09fbacc6ac16515747d0b1f3 (patch)
tree82d98883cabd5fc4e4ea40398a0325d87ace27e8 /apps/gui/bitmap/list.c
parentf9bf137b67d16a03100e392ab2171ae4a0ec0bba (diff)
downloadrockbox-e1753de41af9149b09fbacc6ac16515747d0b1f3.tar.gz
rockbox-e1753de41af9149b09fbacc6ac16515747d0b1f3.zip
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
Diffstat (limited to 'apps/gui/bitmap/list.c')
-rw-r--r--apps/gui/bitmap/list.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index bf0d22df32..abae87e3b5 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -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)