diff options
| author | Jonathan Gordon <rockbox@jdgordon.info> | 2008-03-26 03:35:24 +0000 |
|---|---|---|
| committer | Jonathan Gordon <rockbox@jdgordon.info> | 2008-03-26 03:35:24 +0000 |
| commit | 5ca15399690a686646d4739b3f4c51c62cc88b68 (patch) | |
| tree | 1c12dc34bae30aedcb38bf5ceed8a2fcedc250c8 /apps/gui/list.c | |
| parent | af395f4db6ad7b83f9d9afefb1c0ceeedd140a45 (diff) | |
| download | rockbox-5ca15399690a686646d4739b3f4c51c62cc88b68.zip rockbox-5ca15399690a686646d4739b3f4c51c62cc88b68.tar.gz rockbox-5ca15399690a686646d4739b3f4c51c62cc88b68.tar.bz2 rockbox-5ca15399690a686646d4739b3f4c51c62cc88b68.tar.xz | |
the menu and list now accepts a parent viewport to draw in (and the menu can be told to not show status/button bars). This lays the groundwork to fix colour problems with plugin menus (see star.c for an example.) This hopefully fixes some button bar issues as well as theme problems.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16812 a1c6a512-1295-4272-9138-f99709370657
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 86de0ae..1f0f0ff 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) * - data : extra data passed to the list callback * - scroll_all : * - selected_size : + * - parent : the parent viewports to use. NULL means the full screen minus + * statusbar if enabled. NOTE: new screens should NOT set this to NULL. */ void gui_synclist_init(struct gui_synclist * gui_list, list_get_name callback_get_item_name, void * data, bool scroll_all, - int selected_size + int selected_size, struct viewport list_parent[NB_SCREENS] ) { int i; @@ -128,7 +130,18 @@ void gui_synclist_init(struct gui_synclist * gui_list, #ifdef HAVE_LCD_BITMAP gui_list->offset_position[i] = 0; #endif - gui_list->parent[i] = &parent[i]; + if (list_parent) + gui_list->parent[i] = &list_parent[i]; + else + { + gui_list->parent[i] = &parent[i]; + gui_list->parent[i]->y = global_settings.statusbar?STATUSBAR_HEIGHT:0; + gui_list->parent[i]->height = screens[i].height - gui_list->parent[i]->y; +#ifdef HAS_BUTTONBAR + if (screens[i].has_buttonbar) + gui_list->parent[i]->height -= BUTTONBAR_HEIGHT; +#endif + } } gui_list->limit_scroll = false; gui_list->data=data; @@ -811,7 +824,7 @@ bool simplelist_show_list(struct simplelist_info *info) else getname = simplelist_static_getname; gui_synclist_init(&lists, getname, info->callback_data, - info->scroll_all, info->selection_size); + info->scroll_all, info->selection_size, NULL); if (info->title) gui_synclist_set_title(&lists, info->title, NOICON); if (info->get_icon) |