From c95adecb0770a7eebcb1a9f945c7bc2e8ff302ed Mon Sep 17 00:00:00 2001 From: Barry Wardell Date: Tue, 6 May 2008 09:35:43 +0000 Subject: 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 --- apps/menus/theme_menu.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/apps/menus/theme_menu.c b/apps/menus/theme_menu.c index 21f7ba4a80..0c01b548b6 100644 --- a/apps/menus/theme_menu.c +++ b/apps/menus/theme_menu.c @@ -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; -- cgit v1.2.3