summaryrefslogtreecommitdiffstats
path: root/apps/gui/list.c
diff options
context:
space:
mode:
authorThomas Martitz <kugel@rockbox.org>2011-10-23 11:05:27 +0000
committerThomas Martitz <kugel@rockbox.org>2011-10-23 11:05:27 +0000
commit155a9f8abd8ae2b79f3e77d7006aeb0bf011065e (patch)
tree30765dd9bcd0393c97efd3385251dd1336b5311b /apps/gui/list.c
parente299eb3ea36cba48875cf35bb1dcc93eaba0d279 (diff)
downloadrockbox-155a9f8abd8ae2b79f3e77d7006aeb0bf011065e.tar.gz
rockbox-155a9f8abd8ae2b79f3e77d7006aeb0bf011065e.tar.bz2
rockbox-155a9f8abd8ae2b79f3e77d7006aeb0bf011065e.zip
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
Diffstat (limited to 'apps/gui/list.c')
-rw-r--r--apps/gui/list.c11
1 files 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;