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
This commit is contained in:
parent
47452dcd5c
commit
6cf7cb9822
3 changed files with 51 additions and 28 deletions
|
@ -236,36 +236,39 @@ void icons_init(void)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
load_icons(global_settings.icon_file, Iconset_user, SCREEN_MAIN);
|
if (global_settings.show_icons)
|
||||||
|
|
||||||
if (global_settings.viewers_icon_file[0] &&
|
|
||||||
global_settings.viewers_icon_file[0] != '-')
|
|
||||||
{
|
{
|
||||||
load_icons(global_settings.viewers_icon_file,
|
load_icons(global_settings.icon_file, Iconset_user, SCREEN_MAIN);
|
||||||
Iconset_viewers, SCREEN_MAIN);
|
|
||||||
read_viewer_theme_file();
|
if (global_settings.viewers_icon_file[0] &&
|
||||||
}
|
global_settings.viewers_icon_file[0] != '-')
|
||||||
else
|
{
|
||||||
{
|
load_icons(global_settings.viewers_icon_file,
|
||||||
load_icons(DEFAULT_VIEWER_BMP, Iconset_viewers, SCREEN_MAIN);
|
Iconset_viewers, SCREEN_MAIN);
|
||||||
}
|
read_viewer_theme_file();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
load_icons(DEFAULT_VIEWER_BMP, Iconset_viewers, SCREEN_MAIN);
|
||||||
|
}
|
||||||
|
|
||||||
#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1)
|
#if defined(HAVE_REMOTE_LCD) && (NB_SCREENS > 1)
|
||||||
load_icons(global_settings.remote_icon_file,
|
load_icons(global_settings.remote_icon_file,
|
||||||
Iconset_user, SCREEN_REMOTE);
|
Iconset_user, SCREEN_REMOTE);
|
||||||
|
|
||||||
if (global_settings.remote_viewers_icon_file[0] &&
|
if (global_settings.remote_viewers_icon_file[0] &&
|
||||||
global_settings.remote_viewers_icon_file[0] != '-')
|
global_settings.remote_viewers_icon_file[0] != '-')
|
||||||
{
|
{
|
||||||
load_icons(global_settings.remote_viewers_icon_file,
|
load_icons(global_settings.remote_viewers_icon_file,
|
||||||
Iconset_viewers, SCREEN_REMOTE);
|
Iconset_viewers, SCREEN_REMOTE);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
load_icons(DEFAULT_REMOTE_VIEWER_BMP,
|
load_icons(DEFAULT_REMOTE_VIEWER_BMP,
|
||||||
Iconset_viewers, SCREEN_REMOTE);
|
Iconset_viewers, SCREEN_REMOTE);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int get_icon_width(enum screen_type screen_type)
|
int get_icon_width(enum screen_type screen_type)
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include "viewport.h"
|
#include "viewport.h"
|
||||||
#include "statusbar-skinned.h"
|
#include "statusbar-skinned.h"
|
||||||
#include "skin_engine/skin_engine.h"
|
#include "skin_engine/skin_engine.h"
|
||||||
|
#include "icons.h"
|
||||||
|
|
||||||
#ifdef HAVE_BACKDROP_IMAGE
|
#ifdef HAVE_BACKDROP_IMAGE
|
||||||
/**
|
/**
|
||||||
|
@ -356,7 +357,25 @@ MENUITEM_FUNCTION(browse_rfms, MENU_FUNC_USEPARAM,
|
||||||
#endif
|
#endif
|
||||||
#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,
|
MENUITEM_FUNCTION(browse_themes, MENU_FUNC_USEPARAM,
|
||||||
ID2P(LANG_CUSTOM_THEME),
|
ID2P(LANG_CUSTOM_THEME),
|
||||||
browse_folder, (void*)&themes, NULL, Icon_Config);
|
browse_folder, (void*)&themes, NULL, Icon_Config);
|
||||||
|
|
|
@ -357,7 +357,8 @@ int do_shortcut_menu(void *ignored)
|
||||||
simplelist_info_init(&list, P2STR(ID2P(LANG_SHORTCUTS)), shortcut_count, NULL);
|
simplelist_info_init(&list, P2STR(ID2P(LANG_SHORTCUTS)), shortcut_count, NULL);
|
||||||
list.get_name = shortcut_menu_get_name;
|
list.get_name = shortcut_menu_get_name;
|
||||||
list.action_callback = shortcut_menu_get_action;
|
list.action_callback = shortcut_menu_get_action;
|
||||||
list.get_icon = shortcut_menu_get_icon;
|
if (global_settings.show_icons)
|
||||||
|
list.get_icon = shortcut_menu_get_icon;
|
||||||
list.title_icon = Icon_Bookmark;
|
list.title_icon = Icon_Bookmark;
|
||||||
|
|
||||||
push_current_activity(ACTIVITY_SHORTCUTSMENU);
|
push_current_activity(ACTIVITY_SHORTCUTSMENU);
|
||||||
|
|
Loading…
Reference in a new issue