diff options
-rw-r--r-- | apps/gui/list.c | 4 | ||||
-rw-r--r-- | apps/menu.c | 10 | ||||
-rw-r--r-- | apps/tree.c | 14 |
3 files changed, 11 insertions, 17 deletions
diff --git a/apps/gui/list.c b/apps/gui/list.c index c649528690..5d5733b4e9 100644 --- a/apps/gui/list.c +++ b/apps/gui/list.c @@ -222,7 +222,7 @@ static void gui_list_draw(struct gui_list * gui_list) int cursor_pos = 0; int icon_pos = 1; int text_pos; - bool draw_icons = (gui_list->callback_get_item_icon != NULL ) ; + bool draw_icons = (gui_list->callback_get_item_icon != NULL && global_settings.show_icons); bool draw_cursor; int i; int lines; @@ -238,7 +238,7 @@ static void gui_list_draw(struct gui_list * gui_list) i = 1; lines = display->nb_lines - 1; - if (gui_list->title_icon != NOICON) + if (gui_list->title_icon != NOICON && draw_icons) { screen_put_iconxy(display, 0, 0, gui_list->title_icon); #ifdef HAVE_LCD_BITMAP diff --git a/apps/menu.c b/apps/menu.c index 8656c903c7..c4b9317e6c 100644 --- a/apps/menu.c +++ b/apps/menu.c @@ -415,20 +415,16 @@ static void init_menu_lists(const struct menu_item_ex *menu, gui_synclist_init(lists,get_menu_item_name,(void*)menu,false,1); #ifdef HAVE_LCD_BITMAP - if (global_settings.show_icons == false) - icon = NOICON; - else if (menu->callback_and_desc->icon == NOICON) + if (menu->callback_and_desc->icon == NOICON) icon = bitmap_icons_6x8[Icon_Submenu_Entered]; else icon = menu->callback_and_desc->icon; gui_synclist_set_title(lists, P2STR(menu->callback_and_desc->desc), icon); - if (global_settings.show_icons) - gui_synclist_set_icon_callback(lists, menu_get_icon); - else + gui_synclist_set_icon_callback(lists, menu_get_icon); #else (void)icon; + gui_synclist_set_icon_callback(lists, NULL); #endif - gui_synclist_set_icon_callback(lists, NULL); gui_synclist_set_nb_items(lists,current_subitems_count); gui_synclist_limit_scroll(lists,true); gui_synclist_select_item(lists, find_menu_selection(selected)); diff --git a/apps/tree.c b/apps/tree.c index ac64fff1f5..a8f40f3d07 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -272,8 +272,7 @@ void browse_root(void) gui_buttonbar_set_display(&tree_buttonbar, &(screens[SCREEN_MAIN]) ); #endif gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1); - gui_synclist_set_icon_callback(&tree_lists, - global_settings.show_icons?&tree_get_fileicon:NULL); + gui_synclist_set_icon_callback(&tree_lists, &tree_get_fileicon); /* not the best place for this call... but... */ root_menu(); } @@ -377,7 +376,7 @@ static int update_dir(void) || global_settings.show_path_in_browser == SHOW_PATH_CURRENT) { gui_synclist_set_title(&tree_lists, tagtree_get_title(&tc), - global_settings.show_icons?filetype_get_icon(ATTR_DIRECTORY):(ICON)NULL); + filetype_get_icon(ATTR_DIRECTORY)); } else { @@ -391,7 +390,7 @@ static int update_dir(void) if (global_settings.show_path_in_browser == SHOW_PATH_FULL) { gui_synclist_set_title(&tree_lists, tc.currdir, - global_settings.show_icons?filetype_get_icon(ATTR_DIRECTORY):(ICON)NULL); + filetype_get_icon(ATTR_DIRECTORY)); } else if (global_settings.show_path_in_browser == SHOW_PATH_CURRENT) { @@ -400,11 +399,11 @@ static int update_dir(void) { /* Display "Files" for the root dir */ gui_synclist_set_title(&tree_lists, str(LANG_DIR_BROWSER), - global_settings.show_icons?filetype_get_icon(ATTR_DIRECTORY):(ICON)NULL); + filetype_get_icon(ATTR_DIRECTORY)); } else gui_synclist_set_title(&tree_lists, title, - global_settings.show_icons?filetype_get_icon(ATTR_DIRECTORY):(ICON)NULL); + filetype_get_icon(ATTR_DIRECTORY)); } else { @@ -414,8 +413,7 @@ static int update_dir(void) } gui_synclist_set_nb_items(&tree_lists, tc.filesindir); - gui_synclist_set_icon_callback(&tree_lists, - global_settings.show_icons?&tree_get_fileicon:NULL); + gui_synclist_set_icon_callback(&tree_lists, tree_get_fileicon); if( tc.selected_item >= tc.filesindir) tc.selected_item=tc.filesindir-1; |