forked from len0rd/rockbox
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
This commit is contained in:
parent
e299eb3ea3
commit
155a9f8abd
1 changed files with 6 additions and 5 deletions
|
|
@ -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 */
|
/* 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);
|
return MAX(lcd_get_dpi()*4/12, (int)font_get(vp->font)->height);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static int list_line_height(const struct viewport *vp)
|
static int list_line_height(const struct viewport *vp)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_TOUCHSCREEN
|
||||||
if (global_settings.list_line_padding == -1)
|
if (global_settings.list_line_padding == -1)
|
||||||
return line_height_from_lcd_dpi(vp);
|
return line_height_from_lcd_dpi(vp);
|
||||||
return font_get(vp->font)->height + global_settings.list_line_padding;
|
return font_get(vp->font)->height + global_settings.list_line_padding;
|
||||||
}
|
#else
|
||||||
|
return font_get(vp->font)->height;
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
static void list_init_viewports(struct gui_synclist *list)
|
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)
|
static int list_get_nb_lines(struct gui_synclist *list, enum screen_type screen)
|
||||||
{
|
{
|
||||||
struct viewport *vp = list->parent[screen];
|
struct viewport *vp = list->parent[screen];
|
||||||
vp->line_height = font_get(vp->font)->height;
|
|
||||||
int lines = skinlist_get_line_count(screen, list);
|
int lines = skinlist_get_line_count(screen, list);
|
||||||
if (lines < 0)
|
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,
|
void gui_synclist_set_viewport_defaults(struct viewport *vp,
|
||||||
enum screen_type screen)
|
enum screen_type screen)
|
||||||
{
|
{
|
||||||
viewport_set_defaults(vp, screen);
|
viewport_set_defaults(vp, screen);
|
||||||
#ifdef HAVE_TOUCHSCREEN
|
|
||||||
vp->line_height = list_line_height(vp);
|
vp->line_height = list_line_height(vp);
|
||||||
#endif
|
|
||||||
#ifdef HAVE_BUTTONBAR
|
#ifdef HAVE_BUTTONBAR
|
||||||
if (screens[screen].has_buttonbar)
|
if (screens[screen].has_buttonbar)
|
||||||
vp->height -= BUTTONBAR_HEIGHT;
|
vp->height -= BUTTONBAR_HEIGHT;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue