summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2009-12-16 08:36:46 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2009-12-16 08:36:46 +0000
commite425371e10c5c18a1996fe7adfb4184a09ebbd8a (patch)
tree80bee7b66110bd31734897a96fe336ea50336923
parentb9aabcb1a40aa2705d720e332bef7c390fb0587a (diff)
downloadrockbox-e425371e10c5c18a1996fe7adfb4184a09ebbd8a.tar.gz
rockbox-e425371e10c5c18a1996fe7adfb4184a09ebbd8a.zip
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
-rw-r--r--apps/filetypes.c2
-rw-r--r--apps/gui/bitmap/list.c3
-rw-r--r--apps/menu.c2
-rw-r--r--apps/menus/recording_menu.c2
-rw-r--r--apps/plugins/disktidy.c2
-rw-r--r--apps/tree.c6
6 files changed, 8 insertions, 9 deletions
diff --git a/apps/filetypes.c b/apps/filetypes.c
index 593085cbd4..1bf83c3316 100644
--- a/apps/filetypes.c
+++ b/apps/filetypes.c
@@ -505,7 +505,7 @@ int filetype_list_viewers(const char* current_file)
505 simplelist_info_init(&info, str(LANG_ONPLAY_OPEN_WITH), count, &data); 505 simplelist_info_init(&info, str(LANG_ONPLAY_OPEN_WITH), count, &data);
506 info.action_callback = openwith_action_callback; 506 info.action_callback = openwith_action_callback;
507 info.get_name = openwith_get_name; 507 info.get_name = openwith_get_name;
508 info.get_icon = openwith_get_icon; 508 info.get_icon = global_settings.show_icons?openwith_get_icon:NULL;
509 return simplelist_show_list(&info); 509 return simplelist_show_list(&info);
510} 510}
511 511
diff --git a/apps/gui/bitmap/list.c b/apps/gui/bitmap/list.c
index 66e93fd302..dd4d41f95f 100644
--- a/apps/gui/bitmap/list.c
+++ b/apps/gui/bitmap/list.c
@@ -173,8 +173,7 @@ void list_draw(struct screen *display, struct gui_synclist *list)
173 173
174 /* setup icon placement */ 174 /* setup icon placement */
175 list_icons = *list_text_vp; 175 list_icons = *list_text_vp;
176 int icon_count = global_settings.show_icons && 176 int icon_count = (list->callback_get_item_icon != NULL) ? 1 : 0;
177 (list->callback_get_item_icon != NULL) ? 1 : 0;
178 if (show_cursor) 177 if (show_cursor)
179 icon_count++; 178 icon_count++;
180 if (icon_count) 179 if (icon_count)
diff --git a/apps/menu.c b/apps/menu.c
index 536b14b7d1..fe5764b29c 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -209,7 +209,7 @@ static void init_menu_lists(const struct menu_item_ex *menu,
209 else 209 else
210 icon = menu->callback_and_desc->icon_id; 210 icon = menu->callback_and_desc->icon_id;
211 gui_synclist_set_title(lists, P2STR(menu->callback_and_desc->desc), icon); 211 gui_synclist_set_title(lists, P2STR(menu->callback_and_desc->desc), icon);
212 gui_synclist_set_icon_callback(lists, menu_get_icon); 212 gui_synclist_set_icon_callback(lists, global_settings.show_icons?menu_get_icon:NULL);
213#else 213#else
214 (void)icon; 214 (void)icon;
215 gui_synclist_set_icon_callback(lists, NULL); 215 gui_synclist_set_icon_callback(lists, NULL);
diff --git a/apps/menus/recording_menu.c b/apps/menus/recording_menu.c
index 7b99b48a2d..4bbc4b163c 100644
--- a/apps/menus/recording_menu.c
+++ b/apps/menus/recording_menu.c
@@ -527,7 +527,7 @@ int rectrigger(void)
527 } 527 }
528 gui_synclist_init(&lists, trigger_get_name, settings, false, 2, vp); 528 gui_synclist_init(&lists, trigger_get_name, settings, false, 2, vp);
529 gui_synclist_set_nb_items(&lists, TRIG_OPTION_COUNT*2); 529 gui_synclist_set_nb_items(&lists, TRIG_OPTION_COUNT*2);
530 gui_synclist_set_icon_callback(&lists, trigger_get_icon); 530 gui_synclist_set_icon_callback(&lists, global_settings.show_icons?trigger_get_icon:NULL);
531 /* restart trigger with new values */ 531 /* restart trigger with new values */
532 settings_apply_trigger(); 532 settings_apply_trigger();
533 peak_meter_trigger (global_settings.rec_trigger_mode != TRIG_MODE_OFF); 533 peak_meter_trigger (global_settings.rec_trigger_mode != TRIG_MODE_OFF);
diff --git a/apps/plugins/disktidy.c b/apps/plugins/disktidy.c
index 84cc220891..ee39972f0b 100644
--- a/apps/plugins/disktidy.c
+++ b/apps/plugins/disktidy.c
@@ -458,8 +458,6 @@ enum tidy_return tidy_lcd_menu(void)
458 { 458 {
459 bool show_icons = rb->global_settings->show_icons; 459 bool show_icons = rb->global_settings->show_icons;
460 struct simplelist_info list; 460 struct simplelist_info list;
461 /* force the icons so its readable */
462 rb->global_settings->show_icons = true;
463 rb->simplelist_info_init(&list, "Files to Clean", 461 rb->simplelist_info_init(&list, "Files to Clean",
464 tidy_type_count, NULL); 462 tidy_type_count, NULL);
465 list.get_icon = get_icon; 463 list.get_icon = get_icon;
diff --git a/apps/tree.c b/apps/tree.c
index 55d3baca00..5a8445cacf 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -295,7 +295,8 @@ void tree_gui_init(void)
295#endif 295#endif
296 gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1, NULL); 296 gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1, NULL);
297 gui_synclist_set_voice_callback(&tree_lists, tree_voice_cb); 297 gui_synclist_set_voice_callback(&tree_lists, tree_voice_cb);
298 gui_synclist_set_icon_callback(&tree_lists, &tree_get_fileicon); 298 gui_synclist_set_icon_callback(&tree_lists,
299 global_settings.show_icons?&tree_get_fileicon:NULL);
299#ifdef HAVE_LCD_COLOR 300#ifdef HAVE_LCD_COLOR
300 gui_synclist_set_color_callback(&tree_lists, &tree_get_filecolor); 301 gui_synclist_set_color_callback(&tree_lists, &tree_get_filecolor);
301#endif 302#endif
@@ -456,7 +457,8 @@ static int update_dir(void)
456 } 457 }
457 458
458 gui_synclist_set_nb_items(&tree_lists, tc.filesindir); 459 gui_synclist_set_nb_items(&tree_lists, tc.filesindir);
459 gui_synclist_set_icon_callback(&tree_lists, tree_get_fileicon); 460 gui_synclist_set_icon_callback(&tree_lists,
461 global_settings.show_icons?tree_get_fileicon:NULL);
460 if( tc.selected_item >= tc.filesindir) 462 if( tc.selected_item >= tc.filesindir)
461 tc.selected_item=tc.filesindir-1; 463 tc.selected_item=tc.filesindir-1;
462 464