diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2008-06-06 18:29:46 +0000 |
---|---|---|
committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2008-06-06 18:29:46 +0000 |
commit | e1753de41af9149b09fbacc6ac16515747d0b1f3 (patch) | |
tree | 82d98883cabd5fc4e4ea40398a0325d87ace27e8 /apps/gui | |
parent | f9bf137b67d16a03100e392ab2171ae4a0ec0bba (diff) | |
download | rockbox-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')
-rw-r--r-- | apps/gui/bitmap/list.c | 14 |
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 | |||
344 | if (y > list_text[SCREEN_MAIN].y) | 344 | if (y > list_text[SCREEN_MAIN].y) |
345 | { | 345 | { |
346 | int i, line_height, actual_y; | 346 | int i, line_height, actual_y; |
347 | |||
347 | actual_y = y - list_text[SCREEN_MAIN].y; | 348 | actual_y = y - list_text[SCREEN_MAIN].y; |
348 | line_height = font_get(parent->font)->height; | 349 | line_height = font_get(parent->font)->height; |
349 | line = -1; | 350 | line = actual_y / line_height; |
350 | for(i=0; i<gui_list->nb_items; i++) | ||
351 | { | ||
352 | if(actual_y > line_height*i && actual_y < line_height*(i+1)) | ||
353 | { | ||
354 | line = i; | ||
355 | break; | ||
356 | } | ||
357 | } | ||
358 | 351 | ||
359 | /* Something went wrong during line detection... */ | 352 | if(actual_y%line_height == 0) /* Pressed a border */ |
360 | if(line == -1) | ||
361 | return ACTION_NONE; | 353 | return ACTION_NONE; |
362 | 354 | ||
363 | if (line != gui_list->selected_item - gui_list->start_item[SCREEN_MAIN] && button ^ BUTTON_REL) | 355 | if (line != gui_list->selected_item - gui_list->start_item[SCREEN_MAIN] && button ^ BUTTON_REL) |