diff options
Diffstat (limited to 'apps/gui/list.c')
-rw-r--r-- | apps/gui/list.c | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index e05e44008b..f875a6559e 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -101,15 +101,7 @@ static void list_init_viewports(struct gui_synclist *list) | |||
101 | { | 101 | { |
102 | FOR_NB_SCREENS(i) | 102 | FOR_NB_SCREENS(i) |
103 | { | 103 | { |
104 | list->parent[i] = &parent[i]; | 104 | gui_synclist_set_viewport_defaults(list->parent[i], i); |
105 | viewport_set_defaults(&parent[i], i); | ||
106 | #ifdef HAVE_TOUCHSCREEN | ||
107 | parent[i].line_height = list_line_height(list->parent[i]); | ||
108 | #endif | ||
109 | #ifdef HAVE_BUTTONBAR | ||
110 | if (screens[i].has_buttonbar) | ||
111 | list->parent[i]->height -= BUTTONBAR_HEIGHT; | ||
112 | #endif | ||
113 | } | 105 | } |
114 | } | 106 | } |
115 | list->dirty_tick = current_tick; | 107 | list->dirty_tick = current_tick; |
@@ -502,6 +494,19 @@ void gui_synclist_set_voice_callback(struct gui_synclist * lists, | |||
502 | lists->callback_speak_item = voice_callback; | 494 | lists->callback_speak_item = voice_callback; |
503 | } | 495 | } |
504 | 496 | ||
497 | void gui_synclist_set_viewport_defaults(struct viewport *vp, | ||
498 | enum screen_type screen) | ||
499 | { | ||
500 | viewport_set_defaults(vp, screen); | ||
501 | #ifdef HAVE_TOUCHSCREEN | ||
502 | vp->line_height = list_line_height(vp); | ||
503 | #endif | ||
504 | #ifdef HAVE_BUTTONBAR | ||
505 | if (screens[screen].has_buttonbar) | ||
506 | vp->height -= BUTTONBAR_HEIGHT; | ||
507 | #endif | ||
508 | } | ||
509 | |||
505 | #ifdef HAVE_LCD_COLOR | 510 | #ifdef HAVE_LCD_COLOR |
506 | void gui_synclist_set_color_callback(struct gui_synclist * lists, | 511 | void gui_synclist_set_color_callback(struct gui_synclist * lists, |
507 | list_get_color color_callback) | 512 | list_get_color color_callback) |