summaryrefslogtreecommitdiffstats
path: root/apps/gui/statusbar-skinned.c
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-11-04 05:10:53 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-11-04 05:10:53 +0000
commita7d784b1d5912b68ca9d921961639fe948404811 (patch)
tree096d85a7f013a250c6affe29f8ab22ececfb34b2 /apps/gui/statusbar-skinned.c
parent5ce8e2cb0d2361606f3646e9fa59a39393500ba8 (diff)
downloadrockbox-a7d784b1d5912b68ca9d921961639fe948404811.tar.gz
rockbox-a7d784b1d5912b68ca9d921961639fe948404811.tar.bz2
rockbox-a7d784b1d5912b68ca9d921961639fe948404811.zip
Fix viewport "UI area" to work based on what was agreed on last week in the mailing lists and IRC:
* viewport_set_defaults() will always set the viewport to the intersection of the user setting and any sbs set user viewport * viewport_set_fullscreen() will always set the viewport to the full display, take care to disable the statusbars if you use this! This patch is from FS#10709 and contains code which will be removed once the current inbuilt statusbar is finally removed. This *may* break themes which dont use the %we or %wd token.. follow up commit to fix this coming... git-svn-id: svn://svn.rockbox.org/rockbox/trunk@23507 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/statusbar-skinned.c')
-rw-r--r--apps/gui/statusbar-skinned.c38
1 files changed, 36 insertions, 2 deletions
diff --git a/apps/gui/statusbar-skinned.c b/apps/gui/statusbar-skinned.c
index 9756401ccb..ba46253f5d 100644
--- a/apps/gui/statusbar-skinned.c
+++ b/apps/gui/statusbar-skinned.c
@@ -77,15 +77,49 @@ void sb_skin_data_load(enum screen_type screen, const char *buf, bool isfile)
loaded_ok[screen] = success;
}
+/* temporary viewport structs while the non-skinned bar is in the build */
+static struct viewport inbuilt[NB_SCREENS];
struct viewport *sb_skin_get_info_vp(enum screen_type screen)
{
- return &find_viewport(VP_INFO_LABEL, sb_skin[screen].data)->vp;
+ int bar_setting = global_settings.statusbar;
+#if NB_SCREENS > 1
+ if (screen == SCREEN_REMOTE)
+ bar_setting = global_settings.remote_statusbar;
+#endif
+ if (bar_setting == STATUSBAR_CUSTOM)
+ return &find_viewport(VP_INFO_LABEL, sb_skin[screen].data)->vp;
+ else if (bar_setting == STATUSBAR_OFF)
+ return NULL;
+ else
+ {
+ viewport_set_fullscreen(&inbuilt[screen], screen);
+ /* WE need to return the UI area.. NOT the statusbar area! */
+ if (bar_setting == STATUSBAR_TOP)
+ inbuilt[screen].y = STATUSBAR_HEIGHT;
+ inbuilt[screen].height -= STATUSBAR_HEIGHT;
+ return &inbuilt[screen];
+ }
}
inline bool sb_skin_get_state(enum screen_type screen)
{
int skinbars = sb_skin[screen].sync_data->statusbars;
- return loaded_ok[screen] && (skinbars & VP_SB_ONSCREEN(screen));
+ /* Temp fix untill the hardcoded bar is removed */
+ int bar_setting = global_settings.statusbar;
+#if NB_SCREENS > 1
+ if (screen == SCREEN_REMOTE)
+ bar_setting = global_settings.remote_statusbar;
+#endif
+ switch (bar_setting)
+ {
+ case STATUSBAR_CUSTOM:
+ return loaded_ok[screen] && (skinbars & VP_SB_ONSCREEN(screen));
+ case STATUSBAR_TOP:
+ case STATUSBAR_BOTTOM:
+ case STATUSBAR_OFF:
+ return (VP_SB_ONSCREEN(screen));
+ }
+ return false; /* Should never actually get here */
}