diff options
Diffstat (limited to 'apps/gui/list.c')
-rw-r--r-- | apps/gui/list.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index 86de0ae312..1f0f0ff01c 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c | |||
@@ -107,12 +107,14 @@ bool list_display_title(struct gui_synclist *list, struct viewport *vp) | |||
107 | * - data : extra data passed to the list callback | 107 | * - data : extra data passed to the list callback |
108 | * - scroll_all : | 108 | * - scroll_all : |
109 | * - selected_size : | 109 | * - selected_size : |
110 | * - parent : the parent viewports to use. NULL means the full screen minus | ||
111 | * statusbar if enabled. NOTE: new screens should NOT set this to NULL. | ||
110 | */ | 112 | */ |
111 | void gui_synclist_init(struct gui_synclist * gui_list, | 113 | void gui_synclist_init(struct gui_synclist * gui_list, |
112 | list_get_name callback_get_item_name, | 114 | list_get_name callback_get_item_name, |
113 | void * data, | 115 | void * data, |
114 | bool scroll_all, | 116 | bool scroll_all, |
115 | int selected_size | 117 | int selected_size, struct viewport list_parent[NB_SCREENS] |
116 | ) | 118 | ) |
117 | { | 119 | { |
118 | int i; | 120 | int i; |
@@ -128,7 +130,18 @@ void gui_synclist_init(struct gui_synclist * gui_list, | |||
128 | #ifdef HAVE_LCD_BITMAP | 130 | #ifdef HAVE_LCD_BITMAP |
129 | gui_list->offset_position[i] = 0; | 131 | gui_list->offset_position[i] = 0; |
130 | #endif | 132 | #endif |
131 | gui_list->parent[i] = &parent[i]; | 133 | if (list_parent) |
134 | gui_list->parent[i] = &list_parent[i]; | ||
135 | else | ||
136 | { | ||
137 | gui_list->parent[i] = &parent[i]; | ||
138 | gui_list->parent[i]->y = global_settings.statusbar?STATUSBAR_HEIGHT:0; | ||
139 | gui_list->parent[i]->height = screens[i].height - gui_list->parent[i]->y; | ||
140 | #ifdef HAS_BUTTONBAR | ||
141 | if (screens[i].has_buttonbar) | ||
142 | gui_list->parent[i]->height -= BUTTONBAR_HEIGHT; | ||
143 | #endif | ||
144 | } | ||
132 | } | 145 | } |
133 | gui_list->limit_scroll = false; | 146 | gui_list->limit_scroll = false; |
134 | gui_list->data=data; | 147 | gui_list->data=data; |
@@ -811,7 +824,7 @@ bool simplelist_show_list(struct simplelist_info *info) | |||
811 | else | 824 | else |
812 | getname = simplelist_static_getname; | 825 | getname = simplelist_static_getname; |
813 | gui_synclist_init(&lists, getname, info->callback_data, | 826 | gui_synclist_init(&lists, getname, info->callback_data, |
814 | info->scroll_all, info->selection_size); | 827 | info->scroll_all, info->selection_size, NULL); |
815 | if (info->title) | 828 | if (info->title) |
816 | gui_synclist_set_title(&lists, info->title, NOICON); | 829 | gui_synclist_set_title(&lists, info->title, NOICON); |
817 | if (info->get_icon) | 830 | if (info->get_icon) |