diff options
author | Jonathan Gordon <rockbox@jdgordon.info> | 2009-07-05 18:07:58 +0000 |
---|---|---|
committer | Jonathan Gordon <rockbox@jdgordon.info> | 2009-07-05 18:07:58 +0000 |
commit | f1034e00f6196c810466da66a9a24bf2e5f61272 (patch) | |
tree | 2e49089d421a75030c3a8e30503907a7f20eb511 /apps/gui/viewport.c | |
parent | 802743a061e01150db544c8e072cd794731b18a7 (diff) | |
download | rockbox-f1034e00f6196c810466da66a9a24bf2e5f61272.tar.gz rockbox-f1034e00f6196c810466da66a9a24bf2e5f61272.zip |
FS#10406 - split the statusbar setting into one for each display, and allow the bar to be at the top or bottom of the display
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@21665 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/viewport.c')
-rw-r--r-- | apps/gui/viewport.c | 34 |
1 files changed, 29 insertions, 5 deletions
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index 22d3eb3eb8..67f63e349b 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c | |||
@@ -49,30 +49,47 @@ int viewport_get_nb_lines(struct viewport *vp) | |||
49 | 49 | ||
50 | static bool showing_bars(enum screen_type screen) | 50 | static bool showing_bars(enum screen_type screen) |
51 | { | 51 | { |
52 | bool ignore = statusbar_enabled & VP_SB_IGNORE_SETTING(screen); | ||
52 | if (statusbar_enabled & VP_SB_ONSCREEN(screen)) | 53 | if (statusbar_enabled & VP_SB_ONSCREEN(screen)) |
54 | { | ||
53 | #ifdef HAVE_LCD_BITMAP | 55 | #ifdef HAVE_LCD_BITMAP |
54 | return global_settings.statusbar || | 56 | #ifdef HAVE_REMOTE_LCD |
55 | (statusbar_enabled & VP_SB_IGNORE_SETTING(screen)); | 57 | if (screen == SCREEN_REMOTE) |
58 | return global_settings.remote_statusbar || ignore; | ||
59 | #endif | ||
60 | return global_settings.statusbar || ignore; | ||
56 | #else | 61 | #else |
57 | return true; | 62 | return true; |
58 | #endif | 63 | #endif |
64 | } | ||
59 | return false; | 65 | return false; |
60 | } | 66 | } |
61 | 67 | ||
62 | void viewport_set_defaults(struct viewport *vp, enum screen_type screen) | 68 | void viewport_set_defaults(struct viewport *vp, enum screen_type screen) |
63 | { | 69 | { |
70 | bool bar_at_top = true; | ||
64 | vp->x = 0; | 71 | vp->x = 0; |
65 | vp->width = screens[screen].lcdwidth; | 72 | vp->width = screens[screen].lcdwidth; |
66 | 73 | ||
67 | #ifdef HAVE_LCD_BITMAP | 74 | #ifdef HAVE_LCD_BITMAP |
68 | vp->drawmode = DRMODE_SOLID; | 75 | vp->drawmode = DRMODE_SOLID; |
69 | vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */ | 76 | vp->font = FONT_UI; /* default to UI to discourage SYSFONT use */ |
70 | 77 | #ifdef HAVE_REMOTE_LCD | |
71 | vp->y = showing_bars(screen)?STATUSBAR_HEIGHT:0; | 78 | if (screen == SCREEN_REMOTE) |
79 | bar_at_top = global_settings.remote_statusbar != STATUSBAR_BOTTOM; | ||
80 | else | ||
81 | #endif | ||
82 | bar_at_top = global_settings.statusbar != STATUSBAR_BOTTOM; | ||
83 | |||
84 | vp->height = screens[screen].lcdheight; | ||
85 | if (bar_at_top && showing_bars(screen)) | ||
86 | vp->y = STATUSBAR_HEIGHT; | ||
87 | else | ||
88 | vp->y = 0; | ||
72 | #else | 89 | #else |
73 | vp->y = 0; | 90 | vp->y = 0; |
74 | #endif | 91 | #endif |
75 | vp->height = screens[screen].lcdheight - vp->y; | 92 | vp->height = screens[screen].lcdheight - (showing_bars(screen)?STATUSBAR_HEIGHT:0); |
76 | 93 | ||
77 | #ifdef HAVE_REMOTE_LCD | 94 | #ifdef HAVE_REMOTE_LCD |
78 | /* We only need this test if there is a remote LCD */ | 95 | /* We only need this test if there is a remote LCD */ |
@@ -136,5 +153,12 @@ void viewportmanager_draw_statusbars(void* data) | |||
136 | void viewportmanager_statusbar_changed(void* data) | 153 | void viewportmanager_statusbar_changed(void* data) |
137 | { | 154 | { |
138 | (void)data; | 155 | (void)data; |
156 | statusbar_enabled = 0; | ||
157 | if (global_settings.statusbar != STATUSBAR_OFF) | ||
158 | statusbar_enabled = VP_SB_ONSCREEN(SCREEN_MAIN); | ||
159 | #ifdef HAVE_REMOTE_LCD | ||
160 | if (global_settings.remote_statusbar != STATUSBAR_OFF) | ||
161 | statusbar_enabled |= VP_SB_ONSCREEN(SCREEN_REMOTE); | ||
162 | #endif | ||
139 | viewportmanager_set_statusbar(statusbar_enabled); | 163 | viewportmanager_set_statusbar(statusbar_enabled); |
140 | } | 164 | } |