From 715111122837440d3a1463d0d6932c469418dcbb Mon Sep 17 00:00:00 2001 From: Frank Gevaerts Date: Wed, 13 Jun 2012 23:07:49 +0200 Subject: Make touchscreen handling work with skinned lists. Change-Id: I7df93319c8f16f05e840d74b022aab4803bb8f80 --- apps/gui/bitmap/list-skinned.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'apps/gui/bitmap/list-skinned.c') diff --git a/apps/gui/bitmap/list-skinned.c b/apps/gui/bitmap/list-skinned.c index 81ef6fc18f..d0803b5dc8 100644 --- a/apps/gui/bitmap/list-skinned.c +++ b/apps/gui/bitmap/list-skinned.c @@ -167,6 +167,20 @@ void skinlist_get_scrollbar(int* nb_item, int* first_shown, int* last_shown) } } +bool skinlist_get_item(struct screen *display, struct gui_synclist *list, int x, int y, int *item) +{ + const int screen = display->screen_type; + if (!skinlist_is_configured(screen, list)) + return false; + + int row = y / listcfg[screen]->height; + int column = x / listcfg[screen]->width; + struct viewport *parent = (list->parent[screen]); + int cols = (parent->width / listcfg[screen]->width); + *item = row * cols+ column; + return true; +} + bool skinlist_draw(struct screen *display, struct gui_synclist *list) { int cur_line, display_lines; -- cgit v1.2.3