From 155a9f8abd8ae2b79f3e77d7006aeb0bf011065e Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 23 Oct 2011 11:05:27 +0000 Subject: Fix FS#12337 properly. Also fixes FS#12345 which the previous commit introduced. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30827 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/list.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/gui/list.c b/apps/gui/list.c index 4a51bdace4..676faa7806 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -84,14 +84,18 @@ static int line_height_from_lcd_dpi(const struct viewport *vp) /* the 4/12 factor is designed for reasonable item size on a 160dpi screen */ return MAX(lcd_get_dpi()*4/12, (int)font_get(vp->font)->height); } +#endif static int list_line_height(const struct viewport *vp) { +#ifdef HAVE_TOUCHSCREEN if (global_settings.list_line_padding == -1) return line_height_from_lcd_dpi(vp); return font_get(vp->font)->height + global_settings.list_line_padding; -} +#else + return font_get(vp->font)->height; #endif +} static void list_init_viewports(struct gui_synclist *list) { @@ -133,7 +137,6 @@ bool list_display_title(struct gui_synclist *list, enum screen_type screen) static int list_get_nb_lines(struct gui_synclist *list, enum screen_type screen) { struct viewport *vp = list->parent[screen]; - vp->line_height = font_get(vp->font)->height; int lines = skinlist_get_line_count(screen, list); if (lines < 0) { @@ -498,10 +501,8 @@ void gui_synclist_set_voice_callback(struct gui_synclist * lists, void gui_synclist_set_viewport_defaults(struct viewport *vp, enum screen_type screen) { - viewport_set_defaults(vp, screen); -#ifdef HAVE_TOUCHSCREEN + viewport_set_defaults(vp, screen); vp->line_height = list_line_height(vp); -#endif #ifdef HAVE_BUTTONBAR if (screens[screen].has_buttonbar) vp->height -= BUTTONBAR_HEIGHT; -- cgit v1.2.3