From 2eb1cb6f826a6542b3947f36a57130de235e530e Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Mon, 7 Sep 2009 17:37:06 +0000 Subject: 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 --- apps/menus/theme_menu.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'apps/menus') diff --git a/apps/menus/theme_menu.c b/apps/menus/theme_menu.c index b4505de4b3..38e052b262 100644 --- a/apps/menus/theme_menu.c +++ b/apps/menus/theme_menu.c @@ -38,6 +38,7 @@ #include "backdrop.h" #include "exported_menus.h" #include "appevents.h" +#include "viewport.h" #if LCD_DEPTH > 1 /** @@ -177,6 +178,20 @@ static int statusbar_callback(int action,const struct menu_item_ex *this_item) { return statusbar_callback_ex(action, this_item, SCREEN_MAIN); } + +#ifdef HAVE_BUTTONBAR +static int buttonbar_callback(int action, const struct menu_item_ex *this_item) +{ + (void)this_item; + switch (action) + { + case ACTION_EXIT_MENUITEM: + viewportmanager_theme_changed(THEME_BUTTONBAR); + break; + } + return ACTION_REDRAW; +} +#endif MENUITEM_SETTING(scrollbar_item, &global_settings.scrollbar, NULL); MENUITEM_SETTING(scrollbar_width, &global_settings.scrollbar_width, NULL); MENUITEM_SETTING(statusbar, &global_settings.statusbar, @@ -185,8 +200,8 @@ MENUITEM_SETTING(statusbar, &global_settings.statusbar, MENUITEM_SETTING(remote_statusbar, &global_settings.remote_statusbar, statusbar_callback_remote); #endif -#if CONFIG_KEYPAD == RECORDER_PAD -MENUITEM_SETTING(buttonbar, &global_settings.buttonbar, NULL); +#ifdef HAVE_BUTTONBAR +MENUITEM_SETTING(buttonbar, &global_settings.buttonbar, buttonbar_callback); #endif MENUITEM_SETTING(volume_type, &global_settings.volume_type, NULL); MENUITEM_SETTING(battery_display, &global_settings.battery_display, NULL); -- cgit v1.2.3