From 3b12634e6bc966cb2b2e7f21e9a435cdd20f0bc4 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 17 Oct 2011 17:38:10 +0000 Subject: Commit FS#12321 - Touchscreen: List line padding, to more easily select lines This adds line padding to lists on touchscreens, in order to make lists reasonably useful without huge fonts. It's configurable: * Automatic (default, line height calculated using a lcd dpi aware function) * Off (status quo, line height = font height) * X pixels (from 2 to 50 in even steps) The automatic setting should/aims to Just Work Out Of The Box on all targets git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30773 a1c6a512-1295-4272-9138-f99709370657 --- apps/gui/viewport.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apps/gui/viewport.c') diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index 2ab6c343ef..c5e44270d4 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c @@ -223,7 +223,7 @@ static bool is_theme_enabled(enum screen_type screen) int viewport_get_nb_lines(const struct viewport *vp) { #ifdef HAVE_LCD_BITMAP - return vp->height/font_get(vp->font)->height; + return vp->height/vp->line_height; #else (void)vp; return 2; @@ -318,6 +318,7 @@ void viewport_set_fullscreen(struct viewport *vp, set_default_align_flags(vp); #endif vp->font = global_status.font_id[screen]; + vp->line_height = font_get(vp->font)->height; vp->drawmode = DRMODE_SOLID; #if LCD_DEPTH > 1 #ifdef HAVE_REMOTE_LCD -- cgit v1.2.3