forked from len0rd/rockbox
Fix FS#10289 - screens showing a list need to check the show_icons setting before setting the callback. the List will now always draw icons if a callback is set (like its always done for voice)
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@24022 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
b9aabcb1a4
commit
e425371e10
6 changed files with 8 additions and 9 deletions
|
@ -505,7 +505,7 @@ int filetype_list_viewers(const char* current_file)
|
||||||
simplelist_info_init(&info, str(LANG_ONPLAY_OPEN_WITH), count, &data);
|
simplelist_info_init(&info, str(LANG_ONPLAY_OPEN_WITH), count, &data);
|
||||||
info.action_callback = openwith_action_callback;
|
info.action_callback = openwith_action_callback;
|
||||||
info.get_name = openwith_get_name;
|
info.get_name = openwith_get_name;
|
||||||
info.get_icon = openwith_get_icon;
|
info.get_icon = global_settings.show_icons?openwith_get_icon:NULL;
|
||||||
return simplelist_show_list(&info);
|
return simplelist_show_list(&info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -173,8 +173,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
|
||||||
|
|
||||||
/* setup icon placement */
|
/* setup icon placement */
|
||||||
list_icons = *list_text_vp;
|
list_icons = *list_text_vp;
|
||||||
int icon_count = global_settings.show_icons &&
|
int icon_count = (list->callback_get_item_icon != NULL) ? 1 : 0;
|
||||||
(list->callback_get_item_icon != NULL) ? 1 : 0;
|
|
||||||
if (show_cursor)
|
if (show_cursor)
|
||||||
icon_count++;
|
icon_count++;
|
||||||
if (icon_count)
|
if (icon_count)
|
||||||
|
|
|
@ -209,7 +209,7 @@ static void init_menu_lists(const struct menu_item_ex *menu,
|
||||||
else
|
else
|
||||||
icon = menu->callback_and_desc->icon_id;
|
icon = menu->callback_and_desc->icon_id;
|
||||||
gui_synclist_set_title(lists, P2STR(menu->callback_and_desc->desc), icon);
|
gui_synclist_set_title(lists, P2STR(menu->callback_and_desc->desc), icon);
|
||||||
gui_synclist_set_icon_callback(lists, menu_get_icon);
|
gui_synclist_set_icon_callback(lists, global_settings.show_icons?menu_get_icon:NULL);
|
||||||
#else
|
#else
|
||||||
(void)icon;
|
(void)icon;
|
||||||
gui_synclist_set_icon_callback(lists, NULL);
|
gui_synclist_set_icon_callback(lists, NULL);
|
||||||
|
|
|
@ -527,7 +527,7 @@ int rectrigger(void)
|
||||||
}
|
}
|
||||||
gui_synclist_init(&lists, trigger_get_name, settings, false, 2, vp);
|
gui_synclist_init(&lists, trigger_get_name, settings, false, 2, vp);
|
||||||
gui_synclist_set_nb_items(&lists, TRIG_OPTION_COUNT*2);
|
gui_synclist_set_nb_items(&lists, TRIG_OPTION_COUNT*2);
|
||||||
gui_synclist_set_icon_callback(&lists, trigger_get_icon);
|
gui_synclist_set_icon_callback(&lists, global_settings.show_icons?trigger_get_icon:NULL);
|
||||||
/* restart trigger with new values */
|
/* restart trigger with new values */
|
||||||
settings_apply_trigger();
|
settings_apply_trigger();
|
||||||
peak_meter_trigger (global_settings.rec_trigger_mode != TRIG_MODE_OFF);
|
peak_meter_trigger (global_settings.rec_trigger_mode != TRIG_MODE_OFF);
|
||||||
|
|
|
@ -458,8 +458,6 @@ enum tidy_return tidy_lcd_menu(void)
|
||||||
{
|
{
|
||||||
bool show_icons = rb->global_settings->show_icons;
|
bool show_icons = rb->global_settings->show_icons;
|
||||||
struct simplelist_info list;
|
struct simplelist_info list;
|
||||||
/* force the icons so its readable */
|
|
||||||
rb->global_settings->show_icons = true;
|
|
||||||
rb->simplelist_info_init(&list, "Files to Clean",
|
rb->simplelist_info_init(&list, "Files to Clean",
|
||||||
tidy_type_count, NULL);
|
tidy_type_count, NULL);
|
||||||
list.get_icon = get_icon;
|
list.get_icon = get_icon;
|
||||||
|
|
|
@ -295,7 +295,8 @@ void tree_gui_init(void)
|
||||||
#endif
|
#endif
|
||||||
gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1, NULL);
|
gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1, NULL);
|
||||||
gui_synclist_set_voice_callback(&tree_lists, tree_voice_cb);
|
gui_synclist_set_voice_callback(&tree_lists, tree_voice_cb);
|
||||||
gui_synclist_set_icon_callback(&tree_lists, &tree_get_fileicon);
|
gui_synclist_set_icon_callback(&tree_lists,
|
||||||
|
global_settings.show_icons?&tree_get_fileicon:NULL);
|
||||||
#ifdef HAVE_LCD_COLOR
|
#ifdef HAVE_LCD_COLOR
|
||||||
gui_synclist_set_color_callback(&tree_lists, &tree_get_filecolor);
|
gui_synclist_set_color_callback(&tree_lists, &tree_get_filecolor);
|
||||||
#endif
|
#endif
|
||||||
|
@ -456,7 +457,8 @@ static int update_dir(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
gui_synclist_set_nb_items(&tree_lists, tc.filesindir);
|
gui_synclist_set_nb_items(&tree_lists, tc.filesindir);
|
||||||
gui_synclist_set_icon_callback(&tree_lists, tree_get_fileicon);
|
gui_synclist_set_icon_callback(&tree_lists,
|
||||||
|
global_settings.show_icons?tree_get_fileicon:NULL);
|
||||||
if( tc.selected_item >= tc.filesindir)
|
if( tc.selected_item >= tc.filesindir)
|
||||||
tc.selected_item=tc.filesindir-1;
|
tc.selected_item=tc.filesindir-1;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue