diff options
author | Thomas Martitz <kugel@rockbox.org> | 2009-09-07 17:37:06 +0000 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2009-09-07 17:37:06 +0000 |
commit | 2eb1cb6f826a6542b3947f36a57130de235e530e (patch) | |
tree | d6ade8f11719173c858f606ad123240a72abc553 /apps/gui/viewport.c | |
parent | 47611321c0adafa4125070ac83aa56817504e579 (diff) | |
download | rockbox-2eb1cb6f826a6542b3947f36a57130de235e530e.tar.gz rockbox-2eb1cb6f826a6542b3947f36a57130de235e530e.zip |
Fix buttonbar handling/theme changed handling in lists.
The lists need to copy to a local parent if a list passes NULL as parent in the init. This was before the commit of custom ui vp, but I removed it since I (wrongly) thought using the ui vp as parent would be fine. Let the viewportmanager fire a event in case when a theme-related setting changed and simply the handling in the lists code.
However the buttonbar handling didn't work before anyway, since list code didn't know if the buttonbar was active (it asked a variable which was always false....).
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22651 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/gui/viewport.c')
-rw-r--r-- | apps/gui/viewport.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/apps/gui/viewport.c b/apps/gui/viewport.c index 63f0b8fc20..281c04b2c5 100644 --- a/apps/gui/viewport.c +++ b/apps/gui/viewport.c | |||
@@ -208,6 +208,13 @@ static void statusbar_toggled(void* param) | |||
208 | void viewportmanager_theme_changed(int which) | 208 | void viewportmanager_theme_changed(int which) |
209 | { | 209 | { |
210 | int i; | 210 | int i; |
211 | #ifdef HAVE_BUTTONBAR | ||
212 | if (which & THEME_BUTTONBAR) | ||
213 | { /* don't handle further, the custom ui viewport ignores the buttonbar, | ||
214 | * as does viewport_set_defaults(), since only lists use it*/ | ||
215 | screens[SCREEN_MAIN].has_buttonbar = global_settings.buttonbar; | ||
216 | } | ||
217 | #endif | ||
211 | if (which & THEME_UI_VIEWPORT) | 218 | if (which & THEME_UI_VIEWPORT) |
212 | { | 219 | { |
213 | int retval = viewport_init_ui_vp(); | 220 | int retval = viewport_init_ui_vp(); |
@@ -245,6 +252,7 @@ void viewportmanager_theme_changed(int which) | |||
245 | viewport_set_fullscreen(&custom_vp[i], i); | 252 | viewport_set_fullscreen(&custom_vp[i], i); |
246 | } | 253 | } |
247 | } | 254 | } |
255 | send_event(GUI_EVENT_THEME_CHANGED, NULL); | ||
248 | } | 256 | } |
249 | 257 | ||
250 | static void viewportmanager_ui_vp_changed(void *param) | 258 | static void viewportmanager_ui_vp_changed(void *param) |
@@ -279,6 +287,11 @@ struct viewport* viewport_get_current_vp(void) | |||
279 | return ui_vp_info.vp; | 287 | return ui_vp_info.vp; |
280 | } | 288 | } |
281 | 289 | ||
290 | bool viewport_ui_vp_get_state(enum screen_type screen) | ||
291 | { | ||
292 | return ui_vp_info.active[screen]; | ||
293 | } | ||
294 | |||
282 | #ifdef HAVE_LCD_COLOR | 295 | #ifdef HAVE_LCD_COLOR |
283 | #define ARG_STRING(_depth) ((_depth) == 2 ? "dddddgg":"dddddcc") | 296 | #define ARG_STRING(_depth) ((_depth) == 2 ? "dddddgg":"dddddcc") |
284 | #else | 297 | #else |