summaryrefslogtreecommitdiffstats
path: root/apps/gui/statusbar-skinned.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-08-02 12:50:23 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-08-02 12:50:23 +0000
commitee4f8a9a6bc313cd878f84a6c9832b6094685460 (patch)
tree2f2e77e7467dafb9a21218d23bad59798f813481 /apps/gui/statusbar-skinned.c
parentbc046ff899b472279bf56b38f6f27ad6f225d2e1 (diff)
downloadrockbox-ee4f8a9a6bc313cd878f84a6c9832b6094685460.tar.gz
rockbox-ee4f8a9a6bc313cd878f84a6c9832b6094685460.tar.bz2
rockbox-ee4f8a9a6bc313cd878f84a6c9832b6094685460.zip
Allow viewport labels to be mostly free text instead of only one character. If this is useful the same will be done for images
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@27665 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/statusbar-skinned.c')
-rw-r--r--apps/gui/statusbar-skinned.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/apps/gui/statusbar-skinned.c b/apps/gui/statusbar-skinned.c
index 4df87c0de5..81eb92923d 100644
--- a/apps/gui/statusbar-skinned.c
+++ b/apps/gui/statusbar-skinned.c
@@ -109,7 +109,7 @@ void sb_skin_data_load(enum screen_type screen, const char *buf, bool isfile)
/* hide the sb's default viewport because it has nasty effect with stuff
* not part of the statusbar,
* hence .sbs's without any other vps are unsupported*/
- struct skin_viewport *vp = find_viewport(VP_DEFAULT_LABEL, data);
+ struct skin_viewport *vp = find_viewport(VP_DEFAULT_LABEL, false, data);
struct skin_element *next_vp = data->tree->next;
if (vp)
@@ -121,29 +121,30 @@ void sb_skin_data_load(enum screen_type screen, const char *buf, bool isfile)
/* hide this viewport, forever */
vp->hidden_flags = VP_NEVER_VISIBLE;
}
- sb_set_info_vp(screen, VP_INFO_LABEL|VP_DEFAULT_LABEL);
+ sb_set_info_vp(screen, VP_DEFAULT_LABEL);
}
if (!success && isfile)
sb_create_from_settings(screen);
}
-static char infovp_label[NB_SCREENS];
-static char oldinfovp_label[NB_SCREENS];
-void sb_set_info_vp(enum screen_type screen, char label)
+static char *infovp_label[NB_SCREENS];
+static char *oldinfovp_label[NB_SCREENS];
+void sb_set_info_vp(enum screen_type screen, char *label)
{
infovp_label[screen] = label;
}
struct viewport *sb_skin_get_info_vp(enum screen_type screen)
{
- if (oldinfovp_label[screen] != infovp_label[screen])
+ if (oldinfovp_label[screen] &&
+ strcmp(oldinfovp_label[screen], infovp_label[screen]))
{
/* UI viewport changed, so force a redraw */
oldinfovp_label[screen] = infovp_label[screen];
viewportmanager_theme_enable(screen, false, NULL);
viewportmanager_theme_undo(screen, true);
}
- return &find_viewport(infovp_label[screen], sb_skin[screen].data)->vp;
+ return &find_viewport(infovp_label[screen], true, sb_skin[screen].data)->vp;
}
#if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)
@@ -301,6 +302,7 @@ void sb_skin_init(void)
int i;
FOR_NB_SCREENS(i)
{
+ oldinfovp_label[i] = NULL;
#ifdef HAVE_ALBUMART
sb_skin_data[i].albumart = NULL;
sb_skin_data[i].playback_aa_slot = -1;