Added one more filetype. ??? in .colors lets you set the color for all
unknown filetypes. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13669 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
f2061599d4
commit
5b25a6e2df
1 changed files with 8 additions and 3 deletions
|
@ -126,7 +126,7 @@ static struct file_type filetypes[MAX_FILETYPES];
|
|||
static int custom_filetype_icons[MAX_FILETYPES];
|
||||
static bool custom_icons_loaded = false;
|
||||
#ifdef HAVE_LCD_COLOR
|
||||
static int custom_colors[MAX_FILETYPES];
|
||||
static int custom_colors[MAX_FILETYPES+1];
|
||||
#endif
|
||||
static int filetype_count = 0;
|
||||
static unsigned char heighest_attr = 0;
|
||||
|
@ -166,6 +166,11 @@ void read_color_theme_file(void) {
|
|||
custom_colors[0] = hex_to_rgb(color);
|
||||
continue;
|
||||
}
|
||||
if (!strcasecmp(ext, "???"))
|
||||
{
|
||||
custom_colors[MAX_FILETYPES] = hex_to_rgb(color);
|
||||
continue;
|
||||
}
|
||||
for (i=1; i<filetype_count; i++)
|
||||
{
|
||||
if (filetypes[i].extension &&
|
||||
|
@ -383,7 +388,7 @@ int filetype_get_color(const char * name, int attr)
|
|||
return custom_colors[0];
|
||||
extension = strrchr(name, '.');
|
||||
if (!extension)
|
||||
return -1;
|
||||
return custom_colors[MAX_FILETYPES];
|
||||
extension++;
|
||||
logf("%s %s",name,extension);
|
||||
for (i=1; i<filetype_count; i++)
|
||||
|
@ -392,7 +397,7 @@ int filetype_get_color(const char * name, int attr)
|
|||
!strcasecmp(extension, filetypes[i].extension))
|
||||
return custom_colors[i];
|
||||
}
|
||||
return -1;
|
||||
return custom_colors[MAX_FILETYPES];
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue