diff options
Diffstat (limited to 'apps/gui/statusbar-skinned.c')
-rw-r--r-- | apps/gui/statusbar-skinned.c | 16 |
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; |