From 6cf7cb9822782295091fb083eab1f2862500b53b Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Sun, 27 Nov 2011 10:10:26 +0000 Subject: Don't load the icons unless show_icons is actually enabled. And respect that setting in the shortcuts menu git-svn-id: svn://svn.rockbox.org/rockbox/trunk@31069 a1c6a512-1295-4272-9138-f99709370657 --- apps/menus/theme_menu.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) (limited to 'apps/menus/theme_menu.c') diff --git a/apps/menus/theme_menu.c b/apps/menus/theme_menu.c index f5af1c7b78..e1077a5efd 100644 --- a/apps/menus/theme_menu.c +++ b/apps/menus/theme_menu.c @@ -39,6 +39,7 @@ #include "viewport.h" #include "statusbar-skinned.h" #include "skin_engine/skin_engine.h" +#include "icons.h" #ifdef HAVE_BACKDROP_IMAGE /** @@ -356,7 +357,25 @@ MENUITEM_FUNCTION(browse_rfms, MENU_FUNC_USEPARAM, #endif #endif -MENUITEM_SETTING(show_icons, &global_settings.show_icons, NULL); + +static int showicons_callback(int action, const struct menu_item_ex *this_item) +{ + (void)this_item; + static bool old_icons; + switch (action) + { + case ACTION_ENTER_MENUITEM: + old_icons = global_settings.show_icons; + break; + case ACTION_EXIT_MENUITEM: + if (old_icons != global_settings.show_icons) + icons_init(); + break; + } + return ACTION_REDRAW; +} + +MENUITEM_SETTING(show_icons, &global_settings.show_icons, showicons_callback); MENUITEM_FUNCTION(browse_themes, MENU_FUNC_USEPARAM, ID2P(LANG_CUSTOM_THEME), browse_folder, (void*)&themes, NULL, Icon_Config); -- cgit v1.2.3