diff options
author | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2010-06-24 14:22:36 +0000 |
---|---|---|
committer | Maurus Cuelenaere <mcuelenaere@gmail.com> | 2010-06-24 14:22:36 +0000 |
commit | 3f4838585f38d44dd1e8296c9bdbce57e4b05f94 (patch) | |
tree | 7680406c2e28cb23242da8f3e2377b0bb3dee1aa /apps/gui/bitmap/list.c | |
parent | 7e37fa926d4a034bc7d156fe6a79d8cdc3a4e639 (diff) | |
download | rockbox-3f4838585f38d44dd1e8296c9bdbce57e4b05f94.tar.gz rockbox-3f4838585f38d44dd1e8296c9bdbce57e4b05f94.zip |
Fix touchscreen scrollbar behaviour when it's on the right.
This was broken since r26922.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27107 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/bitmap/list.c')
-rw-r--r-- | apps/gui/bitmap/list.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c index b5e253d486..09c89618f6 100644 --- a/apps/gui/bitmap/list.c +++ b/apps/gui/bitmap/list.c @@ -347,24 +347,16 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list) short x, y; const int button = action_get_touchscreen_press(&x, &y); int line; - const int screen = SCREEN_MAIN; + const struct screen *display = &screens[SCREEN_MAIN]; + const int screen = display->screen_type; const int list_start_item = gui_list->start_item[screen]; const struct viewport *list_text_vp = &list_text[screen]; - int list_width = list_text_vp->width; - - if (global_settings.scrollbar == SCROLLBAR_RIGHT) - list_width += SCROLLBAR_WIDTH; if (button == BUTTON_NONE) return ACTION_NONE; - /* make sure it is inside the UI viewport */ - if (list_display_title(gui_list, screen) && - viewport_point_within_vp(&title_text[screen], x, y) && - button == BUTTON_REL) - return ACTION_STD_CANCEL; - - if (!viewport_point_within_vp(list_text_vp, x, y)) + if (global_settings.scrollbar == SCROLLBAR_RIGHT && + x > list_text_vp->x + list_text_vp->width + SCROLLBAR_WIDTH) /* wider than the list's viewport, ignore it */ return ACTION_NONE; @@ -471,6 +463,9 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list) else return ACTION_NONE; } + /* Everything above the items is cancel */ + else if (y < list_text_vp->y && button == BUTTON_REL) + return ACTION_STD_CANCEL; } return ACTION_NONE; } |