summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorFred Bauer <fred.w.bauer@gmail.com>2011-10-22 17:13:33 +0000
committerFred Bauer <fred.w.bauer@gmail.com>2011-10-22 17:13:33 +0000
commite299eb3ea36cba48875cf35bb1dcc93eaba0d279 (patch)
treea2d9e853522207fae414d82c9f5e6dba81252ea4 /apps
parent4d2ab32339fb8e7c02841e52d35498081503d188 (diff)
downloadrockbox-e299eb3ea36cba48875cf35bb1dcc93eaba0d279.tar.gz
rockbox-e299eb3ea36cba48875cf35bb1dcc93eaba0d279.tar.bz2
rockbox-e299eb3ea36cba48875cf35bb1dcc93eaba0d279.zip
Add functions font_set_ui() and font_get_ui(). The font returned by FONT_UI used to be fixed at zero but since buflib-fonts (r30589) can be different, depending on the order of loads and unloads. Fixes broken behavoir in virtual keyboard (FS#12336), lyrics player (FS#12306), and hopefully, FS#12337
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30826 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r--apps/filetree.c5
-rw-r--r--apps/gui/list.c1
-rw-r--r--apps/settings.c1
3 files changed, 6 insertions, 1 deletions
diff --git a/apps/filetree.c b/apps/filetree.c
index 59e7343600..2407be9d79 100644
--- a/apps/filetree.c
+++ b/apps/filetree.c
@@ -427,7 +427,10 @@ static void ft_load_font(char *file)
current_font_id = global_status.font_id[screen];
if (current_font_id >= 0)
font_unload(current_font_id);
- global_status.font_id[screen] = font_load(file);
+ current_font_id = font_load(file);
+ if(screen==SCREEN_MAIN)
+ font_set_ui(current_font_id);
+ global_status.font_id[screen] = current_font_id;
viewportmanager_theme_changed(THEME_UI_VIEWPORT);
}
#endif
diff --git a/apps/gui/list.c b/apps/gui/list.c
index f875a6559e..4a51bdace4 100644
--- a/apps/gui/list.c
+++ b/apps/gui/list.c
@@ -133,6 +133,7 @@ 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)
{
diff --git a/apps/settings.c b/apps/settings.c
index 21665e0c6a..7142cfb0c6 100644
--- a/apps/settings.c
+++ b/apps/settings.c
@@ -886,6 +886,7 @@ void settings_apply(bool read_disk)
if (global_status.font_id[SCREEN_MAIN] >= 0)
font_unload(global_status.font_id[SCREEN_MAIN]);
rc = font_load(buf);
+ font_set_ui(rc);
CHART2("<font_load ", global_settings.font_file);
global_status.font_id[SCREEN_MAIN] = rc;
lcd_setfont(rc);