Icons in the menus. Thanks midkay for them.

Any menus which dont yet show them are not converted to the new system.


git-svn-id: svn://svn.rockbox.org/rockbox/trunk@12300 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jonathan Gordon 2007-02-14 06:58:30 +00:00
parent 7df87126f0
commit 5599d6806d
13 changed files with 170 additions and 53 deletions

View file

@ -374,12 +374,43 @@ static char * get_menu_item_name(int selected_item,void * data, char *buffer)
} }
return P2STR(menu->callback_and_desc->desc); return P2STR(menu->callback_and_desc->desc);
} }
#ifdef HAVE_LCD_BITMAP
static void menu_get_icon(int selected_item, void * data, ICON * icon)
{
const struct menu_item_ex *menu = (const struct menu_item_ex *)data;
selected_item = get_menu_selection(selected_item, menu);
menu = menu->submenus[selected_item];
switch (menu->flags&MENU_TYPE_MASK)
{
case MT_SETTING:
*icon = bitmap_icons_6x8[Icon_Menu_setting];
break;
case MT_MENU:
if (menu->callback_and_desc->icon == NOICON)
*icon = bitmap_icons_6x8[Icon_Submenu];
else
*icon = menu->callback_and_desc->icon;
break;
case MT_FUNCTION_CALL:
case MT_FUNCTION_WITH_PARAM:
if (menu->callback_and_desc->icon == NOICON)
*icon = bitmap_icons_6x8[Icon_Menu_functioncall];
else
*icon = menu->callback_and_desc->icon;
break;
default:
*icon = NOICON;
}
}
#endif
static void init_menu_lists(const struct menu_item_ex *menu, static void init_menu_lists(const struct menu_item_ex *menu,
struct gui_synclist *lists, int selected, bool callback) struct gui_synclist *lists, int selected, bool callback)
{ {
int i, count = (menu->flags&MENU_COUNT_MASK)>>MENU_COUNT_SHIFT; int i, count = (menu->flags&MENU_COUNT_MASK)>>MENU_COUNT_SHIFT;
menu_callback_type menu_callback = NULL; menu_callback_type menu_callback = NULL;
ICON icon = NOICON;
current_subitems_count = 0; current_subitems_count = 0;
for (i=0; i<count; i++) for (i=0; i<count; i++)
{ {
@ -401,7 +432,20 @@ static void init_menu_lists(const struct menu_item_ex *menu,
} }
gui_synclist_init(lists,get_menu_item_name,(void*)menu,false,1); gui_synclist_init(lists,get_menu_item_name,(void*)menu,false,1);
gui_synclist_set_title(lists, P2STR(menu->callback_and_desc->desc), NOICON); #ifdef HAVE_LCD_BITMAP
if (global_settings.show_icons == false)
icon = NOICON;
else if (menu->callback_and_desc->icon == NOICON)
icon = bitmap_icons_6x8[Icon_Submenu_Entered];
else
icon = menu->callback_and_desc->icon;
#endif
gui_synclist_set_title(lists, P2STR(menu->callback_and_desc->desc), icon);
#ifdef HAVE_LCD_BITMAP
if (global_settings.show_icons)
gui_synclist_set_icon_callback(lists, menu_get_icon);
else
#endif
gui_synclist_set_icon_callback(lists, NULL); gui_synclist_set_icon_callback(lists, NULL);
gui_synclist_set_nb_items(lists,current_subitems_count); gui_synclist_set_nb_items(lists,current_subitems_count);
gui_synclist_limit_scroll(lists,true); gui_synclist_limit_scroll(lists,true);

View file

@ -21,6 +21,9 @@
#define __MENU_H__ #define __MENU_H__
#include <stdbool.h> #include <stdbool.h>
#include "icon.h"
#include "icons.h"
struct menu_item { struct menu_item {
unsigned char *desc; /* string or ID */ unsigned char *desc; /* string or ID */
@ -90,6 +93,9 @@ struct menu_item_ex {
int (*menu_callback)(int action, int (*menu_callback)(int action,
const struct menu_item_ex *this_item); const struct menu_item_ex *this_item);
unsigned char *desc; /* string or ID */ unsigned char *desc; /* string or ID */
#ifdef HAVE_LCD_BITMAP
ICON icon; /* Icon to display */
#endif
} *callback_and_desc; } *callback_and_desc;
}; };
}; };
@ -119,26 +125,28 @@ int do_menu(const struct menu_item_ex *menu);
and its return value will be the index of the chosen item */ and its return value will be the index of the chosen item */
#define MENUITEM_STRINGLIST(name, str, callback, ... ) \ #define MENUITEM_STRINGLIST(name, str, callback, ... ) \
static const char *name##_[] = {__VA_ARGS__}; \ static const char *name##_[] = {__VA_ARGS__}; \
static const struct menu_callback_with_desc name##__ = {callback,str}; \ static const struct menu_callback_with_desc name##__ = {callback,str, NOICON};\
static const struct menu_item_ex name = \ static const struct menu_item_ex name = \
{MT_RETURN_ID|MENU_HAS_DESC| \ {MT_RETURN_ID|MENU_HAS_DESC| \
MENU_ITEM_COUNT(sizeof( name##_)/sizeof(*name##_)), \ MENU_ITEM_COUNT(sizeof( name##_)/sizeof(*name##_)), \
{ .submenus = name##_},{.callback_and_desc = & name##__}}; { .submenus = name##_},{.callback_and_desc = & name##__}};
#ifdef HAVE_LCD_BITMAP /* Kill the player port already.... PLEASE!! */
/* This one should be static'ed also, /* This one should be static'ed also,
but cannot be done untill settings menu is done */ but cannot be done untill settings menu is done */
/* Use this to put a function call into the menu. /* Use this to put a function call into the menu.
When the user selects this item the function will be run, When the user selects this item the function will be run,
when it exits the user will be back in the menu. return value is ignored */ when it exits the user will be back in the menu. return value is ignored */
#define MENUITEM_FUNCTION(name, str, func, callback) \ #define MENUITEM_FUNCTION(name, str, func, callback, icon) \
static const struct menu_callback_with_desc name##_ = {callback,str}; \ static const struct menu_callback_with_desc name##_ = {callback,str,icon}; \
const struct menu_item_ex name = \ const struct menu_item_ex name = \
{ MT_FUNCTION_CALL|MENU_HAS_DESC, { .function = func}, \ { MT_FUNCTION_CALL|MENU_HAS_DESC, { .function = func}, \
{.callback_and_desc = & name##_}}; {.callback_and_desc = & name##_}};
/* Same as above, except the function will be called with a (void*)param. */ /* Same as above, except the function will be called with a (void*)param. */
#define MENUITEM_FUNCTION_WPARAM(name, str, func, param, callback) \ #define MENUITEM_FUNCTION_WPARAM(name, str, func, param, callback, icon) \
static const struct menu_callback_with_desc name##_ = {callback,str}; \ static const struct menu_callback_with_desc name##_ = {callback,str,icon}; \
static const struct menu_func_with_param name##__ = {func, param}; \ static const struct menu_func_with_param name##__ = {func, param}; \
static const struct menu_item_ex name = \ static const struct menu_item_ex name = \
{ MT_FUNCTION_WITH_PARAM|MENU_HAS_DESC, \ { MT_FUNCTION_WITH_PARAM|MENU_HAS_DESC, \
@ -147,11 +155,35 @@ int do_menu(const struct menu_item_ex *menu);
/* Use this to actually create a menu. the ... argument is a list of pointers /* Use this to actually create a menu. the ... argument is a list of pointers
to any of the above macro'd variables. (It can also have other menus in the list. */ to any of the above macro'd variables. (It can also have other menus in the list. */
#define MAKE_MENU( name, str, callback, ... ) \ #define MAKE_MENU( name, str, callback, icon, ... ) \
static const struct menu_item_ex *name##_[] = {__VA_ARGS__}; \
static const struct menu_callback_with_desc name##__ = {callback,str,icon};\
const struct menu_item_ex name = \
{MT_MENU|MENU_HAS_DESC| \
MENU_ITEM_COUNT(sizeof( name##_)/sizeof(*name##_)), \
{ (void*)name##_},{.callback_and_desc = & name##__}};
#else /* HAVE_LCD_BITMAP */
#define MENUITEM_FUNCTION(name, str, func, callback, icon) \
static const struct menu_callback_with_desc name##_ = {callback,str}; \
const struct menu_item_ex name = \
{ MT_FUNCTION_CALL|MENU_HAS_DESC, { .function = func}, \
{.callback_and_desc = & name##_}};
#define MENUITEM_FUNCTION_WPARAM(name, str, func, param, callback, icon) \
static const struct menu_callback_with_desc name##_ = {callback,str}; \
static const struct menu_func_with_param name##__ = {func, param}; \
static const struct menu_item_ex name = \
{ MT_FUNCTION_WITH_PARAM|MENU_HAS_DESC, \
{ .func_with_param = &name##__}, \
{.callback_and_desc = & name##_}};
#define MAKE_MENU( name, str, callback, icon, ... ) \
static const struct menu_item_ex *name##_[] = {__VA_ARGS__}; \ static const struct menu_item_ex *name##_[] = {__VA_ARGS__}; \
static const struct menu_callback_with_desc name##__ = {callback,str};\ static const struct menu_callback_with_desc name##__ = {callback,str};\
const struct menu_item_ex name = \ const struct menu_item_ex name = \
{MT_MENU|MENU_HAS_DESC| \ {MT_MENU|MENU_HAS_DESC| \
MENU_ITEM_COUNT(sizeof( name##_)/sizeof(*name##_)), \ MENU_ITEM_COUNT(sizeof( name##_)/sizeof(*name##_)), \
{ (void*)name##_},{.callback_and_desc = & name##__}}; { (void*)name##_},{.callback_and_desc = & name##__}};
#endif /* HAVE_LCD_BITMAP */
#endif /* End __MENU_H__ */ #endif /* End __MENU_H__ */

View file

@ -29,4 +29,5 @@
#include "settings_menu.h" #include "settings_menu.h"
bool display_settings_menu(void); /* from ../settings_menu.c */ bool display_settings_menu(void); /* from ../settings_menu.c */
MENUITEM_FUNCTION(display_menu,ID2P(LANG_DISPLAY),(menu_function)display_settings_menu,NULL); MENUITEM_FUNCTION(display_menu,ID2P(LANG_DISPLAY),
(menu_function)display_settings_menu,NULL, bitmap_icons_6x8[Icon_Display_menu]);

View file

@ -58,23 +58,24 @@ static int browse_folder(void *param)
return rockbox_browse(info->dir, info->show_options); return rockbox_browse(info->dir, info->show_options);
} }
MENUITEM_FUNCTION_WPARAM(browse_themes, ID2P(LANG_CUSTOM_THEME), MENUITEM_FUNCTION_WPARAM(browse_themes, ID2P(LANG_CUSTOM_THEME),
browse_folder, (void*)&theme, NULL); browse_folder, (void*)&theme, NULL, bitmap_icons_6x8[Icon_Folder]);
MENUITEM_FUNCTION_WPARAM(browse_plugins, ID2P(LANG_PLUGINS), MENUITEM_FUNCTION_WPARAM(browse_plugins, ID2P(LANG_PLUGINS),
browse_folder, (void*)&rocks, NULL); browse_folder, (void*)&rocks, NULL, bitmap_icons_6x8[Icon_Plugin]);
#ifdef CONFIG_TUNER #ifdef CONFIG_TUNER
MENUITEM_FUNCTION(load_radio_screen, ID2P(LANG_FM_RADIO), MENUITEM_FUNCTION(load_radio_screen, ID2P(LANG_FM_RADIO),
(menu_function)radio_screen, dynamicitem_callback); (menu_function)radio_screen, dynamicitem_callback,
bitmap_icons_6x8[Icon_Radio_screen]);
#endif #endif
#include "settings_menu.h" #include "settings_menu.h"
MENUITEM_FUNCTION(manage_settings_menu_item, ID2P(LANG_MANAGE_MENU), MENUITEM_FUNCTION(manage_settings_menu_item, ID2P(LANG_MANAGE_MENU),
(menu_function)manage_settings_menu, NULL); (menu_function)manage_settings_menu, NULL, bitmap_icons_6x8[Icon_Config]);
bool info_menu(void); /* from apps/main_menu.c TEMP*/ bool info_menu(void); /* from apps/main_menu.c TEMP*/
MENUITEM_FUNCTION(info_menu_item, ID2P(LANG_INFO), MENUITEM_FUNCTION(info_menu_item, ID2P(LANG_INFO),
(menu_function)info_menu, NULL); (menu_function)info_menu, NULL, bitmap_icons_6x8[Icon_Questionmark]);
MENUITEM_FUNCTION(mrb_bookmarks, ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS), MENUITEM_FUNCTION(mrb_bookmarks, ID2P(LANG_BOOKMARK_MENU_RECENT_BOOKMARKS),
(menu_function)bookmark_mrb_load, NULL); (menu_function)bookmark_mrb_load, NULL, bitmap_icons_6x8[Icon_Bookmark]);
#ifdef HAVE_LCD_CHARCELLS #ifdef HAVE_LCD_CHARCELLS
static int do_shutdown(void) static int do_shutdown(void)
@ -82,12 +83,12 @@ static int do_shutdown(void)
sys_poweroff(); sys_poweroff();
return 0; return 0;
} }
MENUITEM_FUNCTION(do_shutdown_item, ID2P(LANG_SHUTDOWN), do_shutdown, NULL); MENUITEM_FUNCTION(do_shutdown_item, ID2P(LANG_SHUTDOWN), do_shutdown, NULL, NOICON);
#endif #endif
/* NOTE: This title will be translatable once we decide what to call this menu /* NOTE: This title will be translatable once we decide what to call this menu
when the root menu comes in... hopefully in the next few days */ when the root menu comes in... hopefully in the next few days */
MAKE_MENU(main_menu_, "Rockbox Main Menu", NULL, MAKE_MENU(main_menu_, "Rockbox Main Menu", NULL, bitmap_icons_6x8[Icon_Submenu_Entered],
&mrb_bookmarks, &sound_settings, &mrb_bookmarks, &sound_settings,
&settings_menu_item, &manage_settings_menu_item, &browse_themes, &settings_menu_item, &manage_settings_menu_item, &browse_themes,
#ifdef CONFIG_TUNER #ifdef CONFIG_TUNER

View file

@ -60,7 +60,7 @@ MENUITEM_SETTING(resume, &global_settings.resume, NULL);
MENUITEM_SETTING(ff_rewind_accel, &global_settings.ff_rewind_accel, NULL); MENUITEM_SETTING(ff_rewind_accel, &global_settings.ff_rewind_accel, NULL);
MENUITEM_SETTING(ff_rewind_min_step, &global_settings.ff_rewind_min_step, NULL); MENUITEM_SETTING(ff_rewind_min_step, &global_settings.ff_rewind_min_step, NULL);
MAKE_MENU(ff_rewind_settings_menu, ID2P(LANG_WIND_MENU), 0, MAKE_MENU(ff_rewind_settings_menu, ID2P(LANG_WIND_MENU), 0, NOICON,
&ff_rewind_min_step, &ff_rewind_accel); &ff_rewind_min_step, &ff_rewind_accel);
#if CONFIG_CODEC == SWCODEC #if CONFIG_CODEC == SWCODEC
int buffermargin_callback(int action,const struct menu_item_ex *this_item) int buffermargin_callback(int action,const struct menu_item_ex *this_item)
@ -95,7 +95,7 @@ MENUITEM_SETTING(crossfade_fade_out_duration,
&global_settings.crossfade_fade_out_duration, setcrossfadeonexit_callback); &global_settings.crossfade_fade_out_duration, setcrossfadeonexit_callback);
MENUITEM_SETTING(crossfade_fade_out_mixmode, MENUITEM_SETTING(crossfade_fade_out_mixmode,
&global_settings.crossfade_fade_out_mixmode,NULL); &global_settings.crossfade_fade_out_mixmode,NULL);
MAKE_MENU(crossfade_settings_menu,ID2P(LANG_CROSSFADE),0, MAKE_MENU(crossfade_settings_menu,ID2P(LANG_CROSSFADE),0, NOICON,
&crossfade, &crossfade_fade_in_delay, &crossfade_fade_in_duration, &crossfade, &crossfade_fade_in_delay, &crossfade_fade_in_duration,
&crossfade_fade_out_delay, &crossfade_fade_out_duration, &crossfade_fade_out_delay, &crossfade_fade_out_duration,
&crossfade_fade_out_mixmode); &crossfade_fade_out_mixmode);
@ -117,7 +117,7 @@ MENUITEM_SETTING(replaygain, &global_settings.replaygain ,replaygain_callback);
MENUITEM_SETTING(replaygain_noclip, &global_settings.replaygain_noclip ,replaygain_callback); MENUITEM_SETTING(replaygain_noclip, &global_settings.replaygain_noclip ,replaygain_callback);
MENUITEM_SETTING(replaygain_type, &global_settings.replaygain_type ,replaygain_callback); MENUITEM_SETTING(replaygain_type, &global_settings.replaygain_type ,replaygain_callback);
MENUITEM_SETTING(replaygain_preamp, &global_settings.replaygain_preamp ,replaygain_callback); MENUITEM_SETTING(replaygain_preamp, &global_settings.replaygain_preamp ,replaygain_callback);
MAKE_MENU(replaygain_settings_menu,ID2P(LANG_REPLAYGAIN),0, MAKE_MENU(replaygain_settings_menu,ID2P(LANG_REPLAYGAIN),0, NOICON,
&replaygain,&replaygain_noclip, &replaygain,&replaygain_noclip,
&replaygain_type,&replaygain_preamp); &replaygain_type,&replaygain_preamp);
@ -150,11 +150,12 @@ MENUITEM_SETTING(audioscrobbler, &global_settings.audioscrobbler, audioscrobbler
MENUITEM_SETTING(unplug_mode, &global_settings.unplug_mode, NULL); MENUITEM_SETTING(unplug_mode, &global_settings.unplug_mode, NULL);
MENUITEM_SETTING(unplug_rw, &global_settings.unplug_rw, NULL); MENUITEM_SETTING(unplug_rw, &global_settings.unplug_rw, NULL);
MENUITEM_SETTING(unplug_autoresume, &global_settings.unplug_autoresume, NULL); MENUITEM_SETTING(unplug_autoresume, &global_settings.unplug_autoresume, NULL);
MAKE_MENU(unplug_menu, ID2P(LANG_UNPLUG), 0, MAKE_MENU(unplug_menu, ID2P(LANG_UNPLUG), 0, NOICON,
&unplug_mode, &unplug_rw, &unplug_autoresume); &unplug_mode, &unplug_rw, &unplug_autoresume);
#endif #endif
MAKE_MENU(playback_menu_item,ID2P(LANG_PLAYBACK),0, MAKE_MENU(playback_menu_item,ID2P(LANG_PLAYBACK),0,
bitmap_icons_6x8[Icon_Playback_menu],
&shuffle_item, &repeat_mode, &play_selected, &resume, &shuffle_item, &repeat_mode, &play_selected, &resume,
&ff_rewind_settings_menu, &ff_rewind_settings_menu,
&buffer_margin, &fade_on_stop, &party_mode, &buffer_margin, &fade_on_stop, &party_mode,

View file

@ -63,17 +63,18 @@ int save_playlist_screen(struct playlist_info* playlist)
return 0; return 0;
} }
MENUITEM_FUNCTION(create_playlist_item, ID2P(LANG_CREATE_PLAYLIST), MENUITEM_FUNCTION(create_playlist_item, ID2P(LANG_CREATE_PLAYLIST),
(int(*)(void))create_playlist, NULL); (int(*)(void))create_playlist, NULL, NOICON);
MENUITEM_FUNCTION(view_playlist, ID2P(LANG_VIEW_DYNAMIC_PLAYLIST), MENUITEM_FUNCTION(view_playlist, ID2P(LANG_VIEW_DYNAMIC_PLAYLIST),
(int(*)(void))playlist_viewer, NULL); (int(*)(void))playlist_viewer, NULL, NOICON);
MENUITEM_FUNCTION_WPARAM(save_playlist, ID2P(LANG_SAVE_DYNAMIC_PLAYLIST), MENUITEM_FUNCTION_WPARAM(save_playlist, ID2P(LANG_SAVE_DYNAMIC_PLAYLIST),
(int(*)(void*))save_playlist_screen, NULL, NULL); (int(*)(void*))save_playlist_screen, NULL, NULL, NOICON);
MENUITEM_FUNCTION(catalog, ID2P(LANG_CATALOG), MENUITEM_FUNCTION(catalog, ID2P(LANG_CATALOG),
(int(*)(void))catalog_view_playlists, NULL); (int(*)(void))catalog_view_playlists, NULL, NOICON);
MENUITEM_SETTING(recursive_dir_insert, &global_settings.recursive_dir_insert, NULL); MENUITEM_SETTING(recursive_dir_insert, &global_settings.recursive_dir_insert, NULL);
MENUITEM_SETTING(warn_on_erase, &global_settings.warnon_erase_dynplaylist, NULL); MENUITEM_SETTING(warn_on_erase, &global_settings.warnon_erase_dynplaylist, NULL);
MAKE_MENU(playlist_menu_item, ID2P(LANG_PLAYLIST_MENU), NULL, MAKE_MENU(playlist_menu_item, ID2P(LANG_PLAYLIST_MENU), NULL,
bitmap_icons_6x8[Icon_Playlist],
&create_playlist_item, &view_playlist, &save_playlist, &catalog, &create_playlist_item, &view_playlist, &save_playlist, &catalog,
&recursive_dir_insert, &warn_on_erase); &recursive_dir_insert, &warn_on_erase);

View file

@ -30,12 +30,13 @@
#ifdef HAVE_RECORDING #ifdef HAVE_RECORDING
MENUITEM_FUNCTION(rec_menu_recording_screen_item, ID2P(LANG_RECORDING_MENU), MENUITEM_FUNCTION(rec_menu_recording_screen_item, ID2P(LANG_RECORDING_MENU),
(menu_function)recording_screen, NULL); (menu_function)recording_screen, NULL, NOICON);
/* TEMP */ /* TEMP */
bool recording_menu(bool no_source); /* from apps/sound_menu.h */ bool recording_menu(bool no_source); /* from apps/sound_menu.h */
MENUITEM_FUNCTION_WPARAM(recording_settings, ID2P(LANG_RECORDING_SETTINGS), MENUITEM_FUNCTION_WPARAM(recording_settings, ID2P(LANG_RECORDING_SETTINGS),
(int (*)(void*))recording_menu,0, NULL); (int (*)(void*))recording_menu,0, NULL, NOICON);
MAKE_MENU(recording_settings_menu,ID2P(LANG_RECORDING),0, MAKE_MENU(recording_settings_menu,ID2P(LANG_RECORDING),
0, bitmap_icons_6x8[Icon_Recording],
&rec_menu_recording_screen_item, &recording_settings); &rec_menu_recording_screen_item, &recording_settings);
#endif #endif

View file

@ -47,15 +47,15 @@ MENUITEM_SETTING(tagcache_ram, &global_settings.tagcache_ram, NULL);
#endif #endif
MENUITEM_SETTING(tagcache_autoupdate, &global_settings.tagcache_autoupdate, NULL); MENUITEM_SETTING(tagcache_autoupdate, &global_settings.tagcache_autoupdate, NULL);
MENUITEM_FUNCTION(tc_init, ID2P(LANG_TAGCACHE_FORCE_UPDATE), MENUITEM_FUNCTION(tc_init, ID2P(LANG_TAGCACHE_FORCE_UPDATE),
(int(*)(void))tagcache_rebuild, NULL); (int(*)(void))tagcache_rebuild, NULL, NOICON);
MENUITEM_FUNCTION(tc_update, ID2P(LANG_TAGCACHE_UPDATE), MENUITEM_FUNCTION(tc_update, ID2P(LANG_TAGCACHE_UPDATE),
(int(*)(void))tagcache_update, NULL); (int(*)(void))tagcache_update, NULL, NOICON);
MENUITEM_SETTING(runtimedb, &global_settings.runtimedb, NULL); MENUITEM_SETTING(runtimedb, &global_settings.runtimedb, NULL);
MENUITEM_FUNCTION(tc_export, ID2P(LANG_TAGCACHE_EXPORT), MENUITEM_FUNCTION(tc_export, ID2P(LANG_TAGCACHE_EXPORT),
(int(*)(void))tagtree_export, NULL); (int(*)(void))tagtree_export, NULL, NOICON);
MENUITEM_FUNCTION(tc_import, ID2P(LANG_TAGCACHE_IMPORT), MENUITEM_FUNCTION(tc_import, ID2P(LANG_TAGCACHE_IMPORT),
(int(*)(void))tagtree_import, NULL); (int(*)(void))tagtree_import, NULL, NOICON);
MAKE_MENU(tagcache_menu, ID2P(LANG_TAGCACHE), 0, MAKE_MENU(tagcache_menu, ID2P(LANG_TAGCACHE), 0, NOICON,
#ifdef HAVE_TC_RAMCACHE #ifdef HAVE_TC_RAMCACHE
&tagcache_ram, &tagcache_ram,
#endif #endif
@ -92,7 +92,8 @@ static int fileview_callback(int action,const struct menu_item_ex *this_item)
return action; return action;
} }
MAKE_MENU(file_menu, ID2P(LANG_FILE), 0, &sort_case, &sort_dir, &sort_file, MAKE_MENU(file_menu, ID2P(LANG_FILE), 0, NOICON,
&sort_case, &sort_dir, &sort_file,
&dirfilter, &browse_current, &show_icons, &show_path_in_browser, &dirfilter, &browse_current, &show_icons, &show_path_in_browser,
#ifdef HAVE_TAGCACHE #ifdef HAVE_TAGCACHE
&tagcache_menu &tagcache_menu
@ -125,7 +126,7 @@ static int usbcharging_callback(int action,const struct menu_item_ex *this_item)
MENUITEM_SETTING(usb_charging, &global_settings.usb_charging, usbcharging_callback); MENUITEM_SETTING(usb_charging, &global_settings.usb_charging, usbcharging_callback);
#endif #endif
#endif #endif
MAKE_MENU(battery_menu, ID2P(LANG_BATTERY_MENU), 0, MAKE_MENU(battery_menu, ID2P(LANG_BATTERY_MENU), 0, NOICON,
&battery_capacity, &battery_capacity,
#if BATTERY_TYPES_COUNT > 1 #if BATTERY_TYPES_COUNT > 1
&battery_type, &battery_type,
@ -164,7 +165,7 @@ static int dircache_callback(int action,const struct menu_item_ex *this_item)
} }
MENUITEM_SETTING(dircache, &global_settings.dircache, dircache_callback); MENUITEM_SETTING(dircache, &global_settings.dircache, dircache_callback);
#endif #endif
MAKE_MENU(disk_menu, ID2P(LANG_DISK_MENU), 0, MAKE_MENU(disk_menu, ID2P(LANG_DISK_MENU), 0, NOICON,
&disk_spindown, &disk_spindown,
#ifdef HAVE_DIRCACHE #ifdef HAVE_DIRCACHE
&dircache, &dircache,
@ -204,9 +205,9 @@ static int timedate_set(void)
return result; return result;
} }
MENUITEM_FUNCTION(time_set, ID2P(LANG_TIME), timedate_set, NULL); MENUITEM_FUNCTION(time_set, ID2P(LANG_TIME), timedate_set, NULL, NOICON);
MENUITEM_SETTING(timeformat, &global_settings.timeformat, NULL); MENUITEM_SETTING(timeformat, &global_settings.timeformat, NULL);
MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), 0, &time_set, &timeformat); MAKE_MENU(time_menu, ID2P(LANG_TIME_MENU), 0, NOICON, &time_set, &timeformat);
#endif #endif
/* System menu */ /* System menu */
@ -241,16 +242,16 @@ static int sleep_timer(void)
&sleep_timer_set, 5, 0, 300, sleep_timer_formatter); &sleep_timer_set, 5, 0, 300, sleep_timer_formatter);
} }
MENUITEM_FUNCTION(sleep_timer_call, ID2P(LANG_SLEEP_TIMER), sleep_timer, NULL); MENUITEM_FUNCTION(sleep_timer_call, ID2P(LANG_SLEEP_TIMER), sleep_timer, NULL, NOICON);
#ifdef HAVE_ALARM_MOD #ifdef HAVE_ALARM_MOD
MENUITEM_FUNCTION(alarm_screen_call, ID2P(LANG_ALARM_MOD_ALARM_MENU), MENUITEM_FUNCTION(alarm_screen_call, ID2P(LANG_ALARM_MOD_ALARM_MENU),
(menu_function)alarm_screen, NULL); (menu_function)alarm_screen, NULL, NOICON);
#endif #endif
/* Limits menu */ /* Limits menu */
MENUITEM_SETTING(max_files_in_dir, &global_settings.max_files_in_dir, NULL); MENUITEM_SETTING(max_files_in_dir, &global_settings.max_files_in_dir, NULL);
MENUITEM_SETTING(max_files_in_playlist, &global_settings.max_files_in_playlist, NULL); MENUITEM_SETTING(max_files_in_playlist, &global_settings.max_files_in_playlist, NULL);
MAKE_MENU(limits_menu, ID2P(LANG_LIMITS_MENU), 0, MAKE_MENU(limits_menu, ID2P(LANG_LIMITS_MENU), 0, NOICON,
&max_files_in_dir, &max_files_in_playlist); &max_files_in_dir, &max_files_in_playlist);
#if CONFIG_CODEC == MAS3507D #if CONFIG_CODEC == MAS3507D
@ -274,7 +275,8 @@ MENUITEM_SETTING(line_in, &global_settings.line_in, linein_callback);
MENUITEM_SETTING(car_adapter_mode, &global_settings.car_adapter_mode, NULL); MENUITEM_SETTING(car_adapter_mode, &global_settings.car_adapter_mode, NULL);
#endif #endif
MAKE_MENU(system_menu, ID2P(LANG_SYSTEM), 0, MAKE_MENU(system_menu, ID2P(LANG_SYSTEM),
0, bitmap_icons_6x8[Icon_System_menu],
#ifndef SIMULATOR #ifndef SIMULATOR
&battery_menu, &battery_menu,
#endif #endif
@ -326,6 +328,7 @@ MENUITEM_SETTING(autocreatebookmark,
MENUITEM_SETTING(autoloadbookmark, &global_settings.autoloadbookmark, NULL); MENUITEM_SETTING(autoloadbookmark, &global_settings.autoloadbookmark, NULL);
MENUITEM_SETTING(usemrb, &global_settings.usemrb, NULL); MENUITEM_SETTING(usemrb, &global_settings.usemrb, NULL);
MAKE_MENU(bookmark_settings_menu, ID2P(LANG_BOOKMARK_SETTINGS), 0, MAKE_MENU(bookmark_settings_menu, ID2P(LANG_BOOKMARK_SETTINGS), 0,
bitmap_icons_6x8[Icon_Bookmark],
&autocreatebookmark, &autoloadbookmark, &usemrb); &autocreatebookmark, &autoloadbookmark, &usemrb);
/* BOOKMARK MENU */ /* BOOKMARK MENU */
/***********************************/ /***********************************/
@ -359,7 +362,7 @@ static int talk_callback(int action,const struct menu_item_ex *this_item)
} }
return action; return action;
} }
MAKE_MENU(voice_settings_menu, ID2P(LANG_VOICE), 0, MAKE_MENU(voice_settings_menu, ID2P(LANG_VOICE), 0, bitmap_icons_6x8[Icon_Voice],
&talk_menu, &talk_dir, &talk_file_item); &talk_menu, &talk_dir, &talk_file_item);
/* VOICE MENU */ /* VOICE MENU */
/***********************************/ /***********************************/
@ -370,9 +373,11 @@ static int language_browse(void)
{ {
return (int)rockbox_browse(LANG_DIR, SHOW_LNG); return (int)rockbox_browse(LANG_DIR, SHOW_LNG);
} }
MENUITEM_FUNCTION(browse_langs, ID2P(LANG_LANGUAGE), language_browse, NULL); MENUITEM_FUNCTION(browse_langs, ID2P(LANG_LANGUAGE), language_browse,
NULL, bitmap_icons_6x8[Icon_Language]);
MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0, MAKE_MENU(settings_menu_item, ID2P(LANG_GENERAL_SETTINGS), 0,
bitmap_icons_6x8[Icon_General_settings_menu],
&playback_menu_item, &file_menu, &display_menu, &system_menu, &playback_menu_item, &file_menu, &display_menu, &system_menu,
&bookmark_settings_menu, &browse_langs, &voice_settings_menu ); &bookmark_settings_menu, &browse_langs, &voice_settings_menu );
/* SETTINGS MENU */ /* SETTINGS MENU */

View file

@ -75,17 +75,17 @@ MENUITEM_SETTING(stereo_width, &global_settings.stereo_width, soundmenu_callback
&global_settings.crossfeed_hf_attenuation, soundmenu_callback); &global_settings.crossfeed_hf_attenuation, soundmenu_callback);
MENUITEM_SETTING(crossfeed_hf_cutoff, MENUITEM_SETTING(crossfeed_hf_cutoff,
&global_settings.crossfeed_hf_cutoff, soundmenu_callback); &global_settings.crossfeed_hf_cutoff, soundmenu_callback);
MAKE_MENU(crossfeed_menu,ID2P(LANG_CROSSFEED),soundmenu_callback, MAKE_MENU(crossfeed_menu,ID2P(LANG_CROSSFEED),soundmenu_callback, NOICON,
&crossfeed, &crossfeed_direct_gain, &crossfeed_cross_gain, &crossfeed, &crossfeed_direct_gain, &crossfeed_cross_gain,
&crossfeed_hf_attenuation, &crossfeed_hf_cutoff); &crossfeed_hf_attenuation, &crossfeed_hf_cutoff);
MENUITEM_FUNCTION(equalizer_menu, ID2P(LANG_EQUALIZER), MENUITEM_FUNCTION(equalizer_menu, ID2P(LANG_EQUALIZER),
(int(*)(void))eq_menu, NULL); (int(*)(void))eq_menu, NULL, NOICON);
MENUITEM_SETTING(dithering_enabled, MENUITEM_SETTING(dithering_enabled,
&global_settings.dithering_enabled, soundmenu_callback); &global_settings.dithering_enabled, soundmenu_callback);
#ifdef HAVE_WM8758 #ifdef HAVE_WM8758
MENUITEM_FUNCTION(hw_equalizer_menu, ID2P(LANG_EQUALIZER_HARDWARE), MENUITEM_FUNCTION(hw_equalizer_menu, ID2P(LANG_EQUALIZER_HARDWARE),
(int(*)(void))eq_hw_menu, NULL); (int(*)(void))eq_hw_menu, NULL, NOICON);
#endif #endif
#endif #endif
@ -102,7 +102,7 @@ MENUITEM_SETTING(stereo_width, &global_settings.stereo_width, soundmenu_callback
MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, MAKE_MENU(sound_settings, ID2P(LANG_SOUND_SETTINGS), NULL, bitmap_icons_6x8[Icon_Audio],
&volume, &volume,
#ifndef HAVE_TLV320 #ifndef HAVE_TLV320
&bass,&treble, &bass,&treble,

View file

@ -56,12 +56,24 @@ const unsigned char bitmap_icons_6x8[][6] =
{ 0x3e, 0x2a, 0x3e, 0x2a, 0x2a, 0x3e }, /* Language file */ { 0x3e, 0x2a, 0x3e, 0x2a, 0x2a, 0x3e }, /* Language file */
{ 0x4e, 0x51, 0x51, 0x40, 0x55, 0x55 }, /* Config file */ { 0x4e, 0x51, 0x51, 0x40, 0x55, 0x55 }, /* Config file */
{ 0x0a, 0x0a, 0x5f, 0x4e, 0x24, 0x18 }, /* Plugin file */ { 0x0a, 0x0a, 0x5f, 0x4e, 0x24, 0x18 }, /* Plugin file */
{ 0xff, 0x81, 0xaf, 0xaa, 0x8c, 0xf8 }, /* Bookmark file */ { 0x7f, 0x41, 0x4f, 0x4a, 0x4c, 0x78 }, /* Bookmark file */
{ 0x5f, 0x45, 0x5b, 0x40, 0x55, 0x55 }, /* Preset file */ { 0x5f, 0x45, 0x5b, 0x40, 0x55, 0x55 }, /* Preset file */
{ 0x77, 0x55, 0x55, 0x55, 0x55, 0x77 }, /* Queued Item */ { 0x77, 0x55, 0x55, 0x55, 0x55, 0x77 }, /* Queued Item */
{ 0x3e, 0x41, 0x3e, 0x1c, 0x1c, 0x08 }, /* Moving Item */ { 0x3e, 0x41, 0x3e, 0x1c, 0x1c, 0x08 }, /* Moving Item */
{ 0x7f, 0x7f, 0x1c, 0x3e, 0x77, 0x63 }, /* Keyboard file */ { 0x7f, 0x7f, 0x1c, 0x3e, 0x77, 0x63 }, /* Keyboard file */
{ 0x00, 0x00, 0x00, 0x08, 0x1c, 0x3e }, /* Reverse Cursor / Marker */ { 0x00, 0x00, 0x00, 0x08, 0x1c, 0x3e }, /* Reverse Cursor / Marker */
{ 0x06, 0x03, 0x5b, 0x5b, 0x0f, 0x06 }, /* question mark */
{ 0x00, 0x18, 0x24, 0x24, 0x18, 0x00 }, /* Menu Settings */
{ 0x00, 0x18, 0x3c, 0x3c, 0x18, 0x00 }, /* function call from the menu */
{ 0x18, 0x18, 0x7e, 0x7e, 0x18, 0x18 }, /* sub menu */
{ 0x01, 0x55, 0x01, 0x55, 0x54, 0x54 }, /* in submenu */
{ 0x1c, 0x3e, 0x7f, 0x7f, 0x3e, 0x1c }, /* Recording menu */
{ 0x1c, 0x1c, 0x22, 0x41, 0x7f, 0x00 }, /* voice menu */
{ 0x06, 0x0f, 0x78, 0x78, 0x0f, 0x06 }, /* general settings menu */
{ 0x1e, 0x22, 0x49, 0x49, 0x22, 0x1e }, /* system menu */
{ 0x7f, 0x7f, 0x3e, 0x1c, 0x08, 0x00 }, /* playback menu */
{ 0x1f, 0x51, 0x71, 0x71, 0x51, 0x1f }, /* display menu */
{ 0x03, 0x05, 0x7f, 0x05, 0x03, 0x00 }, /* radio */
}; };
const unsigned char bitmap_icons_7x8[][7] = const unsigned char bitmap_icons_7x8[][7] =

View file

@ -19,6 +19,8 @@
#ifndef _ICONS_H_ #ifndef _ICONS_H_
#define _ICONS_H_ #define _ICONS_H_
#ifndef PLUGIN
#include <lcd.h> #include <lcd.h>
#ifdef HAVE_LCD_BITMAP #ifdef HAVE_LCD_BITMAP
@ -64,6 +66,18 @@ enum icons_6x8 {
Icon_Moving, Icon_Moving,
Icon_Keyboard, Icon_Keyboard,
Icon_Reverse_Cursor, Icon_Reverse_Cursor,
Icon_Questionmark,
Icon_Menu_setting,
Icon_Menu_functioncall,
Icon_Submenu,
Icon_Submenu_Entered,
Icon_Recording,
Icon_Voice,
Icon_General_settings_menu,
Icon_System_menu,
Icon_Playback_menu,
Icon_Display_menu,
Icon_Radio_screen,
Icon6x8Last, Icon6x8Last,
}; };
@ -163,5 +177,5 @@ extern void statusbar_led(void);
#endif #endif
#endif /* End HAVE_LCD_BITMAP */ #endif /* End HAVE_LCD_BITMAP */
#endif /* PLUGIN */
#endif /* _ICONS_H_ */ #endif /* _ICONS_H_ */

View file

@ -1096,7 +1096,13 @@ static bool do_set_setting(const unsigned char* string, void *variable,
else oldvalue = *(bool*)variable; else oldvalue = *(bool*)variable;
gui_synclist_init(&lists,value_setting_get_name_cb,(void*)cb_data,false,1); gui_synclist_init(&lists,value_setting_get_name_cb,(void*)cb_data,false,1);
gui_synclist_set_title(&lists, (char*)string, NOICON); gui_synclist_set_title(&lists, (char*)string,
#ifdef HAVE_LCD_BITMAP
bitmap_icons_6x8[Icon_Questionmark]
#else
NOICON
#endif
);
gui_synclist_set_icon_callback(&lists,NULL); gui_synclist_set_icon_callback(&lists,NULL);
gui_synclist_set_nb_items(&lists,nb_items); gui_synclist_set_nb_items(&lists,nb_items);
gui_synclist_limit_scroll(&lists,true); gui_synclist_limit_scroll(&lists,true);

View file

@ -24,7 +24,6 @@
#include "screens.h" #include "screens.h"
#include "button.h" #include "button.h"
#include "menu.h"
#include "string.h" #include "string.h"
#include "lcd.h" #include "lcd.h"