summaryrefslogtreecommitdiffstats
path: root/apps/gui/list.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-10-22 10:09:23 +0000
committerThomas Martitz <kugel@rockbox.org>2011-10-22 10:09:23 +0000
commit5c509d17db86e889560e7d938b5a7acf083948e2 (patch)
treeaf7cfcd615d2b48cda55ffecf975a384ed3e5610 /apps/gui/list.c
parent09d0b6fec4988677b3bb4f73a13dd4fa961c3f5a (diff)
downloadrockbox-5c509d17db86e889560e7d938b5a7acf083948e2.tar.gz
rockbox-5c509d17db86e889560e7d938b5a7acf083948e2.tar.bz2
rockbox-5c509d17db86e889560e7d938b5a7acf083948e2.zip
Fix buttonbar and line padding in time&date screen.
The time&date screen uses a custom parent for do_menu(), and doesn't account for the buttonbar and list line height. Introduce gui_synclist_set_viewport_defaults() to set those for viewports that are going to be list parents and use that so that time&date screen doesn't need to know about buttonbar/line padding. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30824 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/list.c')
-rw-r--r--apps/gui/list.c23
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)
{
FOR_NB_SCREENS(i)
{
- list->parent[i] = &parent[i];
- viewport_set_defaults(&parent[i], i);
-#ifdef HAVE_TOUCHSCREEN
- parent[i].line_height = list_line_height(list->parent[i]);
-#endif
-#ifdef HAVE_BUTTONBAR
- if (screens[i].has_buttonbar)
- list->parent[i]->height -= BUTTONBAR_HEIGHT;
-#endif
+ gui_synclist_set_viewport_defaults(list->parent[i], i);
}
}
list->dirty_tick = current_tick;
@@ -502,6 +494,19 @@ void gui_synclist_set_voice_callback(struct gui_synclist * lists,
lists->callback_speak_item = voice_callback;
}
+void gui_synclist_set_viewport_defaults(struct viewport *vp,
+ enum screen_type screen)
+{
+ viewport_set_defaults(vp, screen);
+#ifdef HAVE_TOUCHSCREEN
+ vp->line_height = list_line_height(vp);
+#endif
+#ifdef HAVE_BUTTONBAR
+ if (screens[screen].has_buttonbar)
+ vp->height -= BUTTONBAR_HEIGHT;
+#endif
+}
+
#ifdef HAVE_LCD_COLOR
void gui_synclist_set_color_callback(struct gui_synclist * lists,
list_get_color color_callback)