From e1753de41af9149b09fbacc6ac16515747d0b1f3 Mon Sep 17 00:00:00 2001 From: Maurus Cuelenaere Date: Fri, 6 Jun 2008 18:29:46 +0000 Subject: 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 --- apps/gui/bitmap/list.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'apps/gui') 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; inb_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) -- cgit v1.2.3