summaryrefslogtreecommitdiffstats
path: root/apps/gui/statusbar-skinned.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2010-05-05 13:48:50 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2010-05-05 13:48:50 +0000
commitefd1f4e49facbcdcbb11dbf6a8ead3843df586d3 (patch)
tree1247db65aa3b5eb15814b01d3becd8dbe98d2eb0 /apps/gui/statusbar-skinned.c
parent268f7c42f0d7128a4c88cb1c9b64b663dd266bf6 (diff)
downloadrockbox-efd1f4e49facbcdcbb11dbf6a8ead3843df586d3.tar.gz
rockbox-efd1f4e49facbcdcbb11dbf6a8ead3843df586d3.tar.bz2
rockbox-efd1f4e49facbcdcbb11dbf6a8ead3843df586d3.zip
Make it possible to move the UI viewport using conditional viewports.
%Vi|<label>|<Usual %Vi params>| <- specify the possible viewports to use %VI<label> <- make the UI viewport use the %Vi definition with the <label> label. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25826 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/statusbar-skinned.c')
-rw-r--r--apps/gui/statusbar-skinned.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/apps/gui/statusbar-skinned.c b/apps/gui/statusbar-skinned.c
index 0902950599..af02b9b54d 100644
--- a/apps/gui/statusbar-skinned.c
+++ b/apps/gui/statusbar-skinned.c
@@ -86,15 +86,29 @@ 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);
}
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)
+{
+ infovp_label[screen] = label;
+}
+
struct viewport *sb_skin_get_info_vp(enum screen_type screen)
{
- return &find_viewport(VP_INFO_LABEL, sb_skin[screen].data)->vp;
+ if (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;
}
#if (LCD_DEPTH > 1) || (defined(HAVE_REMOTE_LCD) && LCD_REMOTE_DEPTH > 1)