1
0
Fork 0
forked from len0rd/rockbox

Fix the colour selector. The only colours not allowed should be when trying to set the fg and bg to the same colour.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17395 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Barry Wardell 2008-05-06 09:35:43 +00:00
parent 5b33a417e3
commit c95adecb07

View file

@ -79,9 +79,16 @@ static struct colour_info
*/
static int set_color_func(void* color)
{
int res, c = (intptr_t)color;
int res, c = (intptr_t)color, banned_color=-1;
/* Don't let foreground be set the same as background and vice-versa */
if (c == COLOR_BG)
banned_color = *colors[COLOR_FG].setting;
else if (c == COLOR_FG)
banned_color = *colors[COLOR_BG].setting;
res = (int)set_color(&screens[SCREEN_MAIN],str(colors[c].lang_id),
colors[c].setting,*colors[c].setting);
colors[c].setting, banned_color);
settings_save();
settings_apply(false);
return res;