1
0
Fork 0
forked from len0rd/rockbox

Small fixes for icon behaviour on the Player: Read viewer icon numbers from viewers.config, and correct the icon selection in icons.c. Now viewer supported filetypes get the mirrored question mark icon instead of no icon at all.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@16389 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2008-02-23 13:12:08 +00:00
parent 01bf4d35ac
commit bc357da2ae
2 changed files with 7 additions and 12 deletions

View file

@ -325,7 +325,6 @@ static void read_config(char* config_file)
filetypes[filetype_count].icon = Icon_Questionmark; filetypes[filetype_count].icon = Icon_Questionmark;
heighest_attr++; heighest_attr++;
/* get the icon */ /* get the icon */
#ifdef HAVE_LCD_BITMAP
s = e+1; s = e+1;
if (*s == '*') if (*s == '*')
filetypes[filetype_count].icon = atoi(s+1); filetypes[filetype_count].icon = atoi(s+1);
@ -333,9 +332,6 @@ static void read_config(char* config_file)
filetypes[filetype_count].icon = Icon_NOICON; filetypes[filetype_count].icon = Icon_NOICON;
else if (*s >= '0' && *s <= '9') else if (*s >= '0' && *s <= '9')
filetypes[filetype_count].icon = Icon_Last_Themeable + atoi(s); filetypes[filetype_count].icon = Icon_Last_Themeable + atoi(s);
#else
filetypes[filetype_count].icon = Icon_NOICON;
#endif
filetype_count++; filetype_count++;
} }
} }

View file

@ -38,9 +38,8 @@ enum old_values{
old_Icon_Config, old_Icon_Config,
}; };
static const long icon_unknown = old_Icon_Unknown; static const unsigned short icons[Icon_Last_Themeable] = {
static const long icons[Icon_Last_Themeable] = { [0 ... Icon_Last_Themeable-1] = ' ',
[0 ... Icon_Last_Themeable-1] = 0,
[Icon_Audio] = old_Icon_Audio, [Icon_Audio] = old_Icon_Audio,
[Icon_Folder] = old_Icon_Folder, [Icon_Folder] = old_Icon_Folder,
@ -52,8 +51,8 @@ static const long icons[Icon_Last_Themeable] = {
[Icon_Config] = old_Icon_Config, [Icon_Config] = old_Icon_Config,
[Icon_Plugin] = old_Icon_Plugin, [Icon_Plugin] = old_Icon_Plugin,
[Icon_Bookmark] = old_Icon_Bookmark, [Icon_Bookmark] = old_Icon_Bookmark,
[Icon_Queued] = 'Q', [Icon_Queued] = old_Icon_Queued,
[Icon_Moving] = 'M', [Icon_Moving] = old_Icon_Moving,
/* /*
[Icon_Keyboard] = , [Icon_Keyboard] = ,
@ -83,10 +82,10 @@ static const long icons[Icon_Last_Themeable] = {
extern void screen_put_iconxy(struct screen * screen, extern void screen_put_iconxy(struct screen * screen,
int x, int y, enum themable_icons icon) int x, int y, enum themable_icons icon)
{ {
if (icon == -1) if (icon == Icon_NOICON)
screen->putc(x, y, icon_unknown);
else if ((icon==Icon_NOICON) && (icons[icon]!=0))
screen->putc(x, y, ' '); screen->putc(x, y, ' ');
else if (icon >= Icon_Last_Themeable)
screen->putc(x, y, old_Icon_Unknown);
else else
screen->putc(x, y, icons[icon]); screen->putc(x, y, icons[icon]);
} }