diff options
Diffstat (limited to 'apps/gui')
-rw-r--r-- | apps/gui/bitmap/list.c | 25 | ||||
-rw-r--r-- | apps/gui/list.c | 1 | ||||
-rw-r--r-- | apps/gui/list.h | 4 |
3 files changed, 14 insertions, 16 deletions
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c index d892bff22b..1af2dfc8ae 100644 --- a/apps/gui/bitmap/list.c +++ b/apps/gui/bitmap/list.c | |||
@@ -47,6 +47,14 @@ | |||
47 | /* these are static to make scrolling work */ | 47 | /* these are static to make scrolling work */ |
48 | static struct viewport list_text[NB_SCREENS], title_text[NB_SCREENS]; | 48 | static struct viewport list_text[NB_SCREENS], title_text[NB_SCREENS]; |
49 | 49 | ||
50 | #ifdef HAVE_TOUCHSCREEN | ||
51 | static enum { | ||
52 | SCROLL_NONE, /* no scrolling */ | ||
53 | SCROLL_BAR, /* scroll by using the scrollbar */ | ||
54 | SCROLL_SWIPE, /* scroll by wiping over the screen */ | ||
55 | } scroll_mode; | ||
56 | #endif | ||
57 | |||
50 | int gui_list_get_item_offset(struct gui_synclist * gui_list, int item_width, | 58 | int gui_list_get_item_offset(struct gui_synclist * gui_list, int item_width, |
51 | int text_pos, struct screen * display, | 59 | int text_pos, struct screen * display, |
52 | struct viewport *vp); | 60 | struct viewport *vp); |
@@ -232,7 +240,12 @@ void list_draw(struct screen *display, struct gui_synclist *list) | |||
232 | } | 240 | } |
233 | #endif | 241 | #endif |
234 | /* draw the selected line */ | 242 | /* draw the selected line */ |
235 | if(!list->hide_selection && i >= list->selected_item | 243 | if( |
244 | #ifdef HAVE_TOUCHSCREEN | ||
245 | /* don't draw it during scrolling */ | ||
246 | scroll_mode == SCROLL_NONE && | ||
247 | #endif | ||
248 | i >= list->selected_item | ||
236 | && i < list->selected_item + list->selected_size | 249 | && i < list->selected_item + list->selected_size |
237 | && list->show_selection_marker) | 250 | && list->show_selection_marker) |
238 | {/* The selected item must be displayed scrolling */ | 251 | {/* The selected item must be displayed scrolling */ |
@@ -311,11 +324,6 @@ void list_draw(struct screen *display, struct gui_synclist *list) | |||
311 | 324 | ||
312 | #if defined(HAVE_TOUCHSCREEN) | 325 | #if defined(HAVE_TOUCHSCREEN) |
313 | /* This needs to be fixed if we ever get more than 1 touchscreen on a target. */ | 326 | /* This needs to be fixed if we ever get more than 1 touchscreen on a target. */ |
314 | static enum { | ||
315 | SCROLL_NONE, /* no scrolling */ | ||
316 | SCROLL_BAR, /* scroll by using the scrollbar */ | ||
317 | SCROLL_SWIPE, /* scroll by wiping over the screen */ | ||
318 | } scroll_mode; | ||
319 | 327 | ||
320 | static bool released = false; | 328 | static bool released = false; |
321 | 329 | ||
@@ -390,10 +398,7 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list) | |||
390 | int line, list_width = list_text_vp->width; | 398 | int line, list_width = list_text_vp->width; |
391 | 399 | ||
392 | released = (button&BUTTON_REL) != 0; | 400 | released = (button&BUTTON_REL) != 0; |
393 | gui_list->hide_selection = (scroll_mode != SCROLL_NONE); | ||
394 | |||
395 | 401 | ||
396 | |||
397 | if (global_settings.scrollbar == SCROLLBAR_RIGHT) | 402 | if (global_settings.scrollbar == SCROLLBAR_RIGHT) |
398 | list_width += SCROLLBAR_WIDTH; | 403 | list_width += SCROLLBAR_WIDTH; |
399 | 404 | ||
@@ -511,8 +516,6 @@ unsigned gui_synclist_do_touchscreen(struct gui_synclist * gui_list) | |||
511 | { | 516 | { |
512 | scroll_mode = SCROLL_NONE; | 517 | scroll_mode = SCROLL_NONE; |
513 | redraw = true; | 518 | redraw = true; |
514 | /* don't draw the selection during scrolling */ | ||
515 | gui_list->hide_selection = false; | ||
516 | } | 519 | } |
517 | 520 | ||
518 | /* select current item */ | 521 | /* select current item */ |
diff --git a/apps/gui/list.c b/apps/gui/list.c index 9ec7d17d6a..b39684ff92 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -155,7 +155,6 @@ void gui_synclist_init(struct gui_synclist * gui_list, | |||
155 | gui_list->callback_speak_item = NULL; | 155 | gui_list->callback_speak_item = NULL; |
156 | gui_list->nb_items = 0; | 156 | gui_list->nb_items = 0; |
157 | gui_list->selected_item = 0; | 157 | gui_list->selected_item = 0; |
158 | gui_list->hide_selection = false; | ||
159 | FOR_NB_SCREENS(i) | 158 | FOR_NB_SCREENS(i) |
160 | { | 159 | { |
161 | gui_list->start_item[i] = 0; | 160 | gui_list->start_item[i] = 0; |
diff --git a/apps/gui/list.h b/apps/gui/list.h index 57ca912800..6deac2de0d 100644 --- a/apps/gui/list.h +++ b/apps/gui/list.h | |||
@@ -94,10 +94,6 @@ struct gui_synclist | |||
94 | /* wether the text of the whole items of the list have to be | 94 | /* wether the text of the whole items of the list have to be |
95 | * scrolled or only for the selected item */ | 95 | * scrolled or only for the selected item */ |
96 | bool scroll_all; | 96 | bool scroll_all; |
97 | /* | ||
98 | * if true the selection bar will not be drawn | ||
99 | */ | ||
100 | bool hide_selection; | ||
101 | int nb_items; | 97 | int nb_items; |
102 | int selected_item; | 98 | int selected_item; |
103 | int start_item[NB_SCREENS]; /* the item that is displayed at the top of the screen */ | 99 | int start_item[NB_SCREENS]; /* the item that is displayed at the top of the screen */ |