summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBarry Wardell <rockbox@barrywardell.net>2008-05-06 09:35:43 +0000
committerBarry Wardell <rockbox@barrywardell.net>2008-05-06 09:35:43 +0000
commitc95adecb0770a7eebcb1a9f945c7bc2e8ff302ed (patch)
treea8fad16d0a80c12c45f4b8e8a7177f5069d06498
parent5b33a417e31ac8af622b92f810b14714efce1874 (diff)
downloadrockbox-c95adecb0770a7eebcb1a9f945c7bc2e8ff302ed.tar.gz
rockbox-c95adecb0770a7eebcb1a9f945c7bc2e8ff302ed.zip
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
-rw-r--r--apps/menus/theme_menu.c11
1 files 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
79 */ 79 */
80static int set_color_func(void* color) 80static int set_color_func(void* color)
81{ 81{
82 int res, c = (intptr_t)color; 82 int res, c = (intptr_t)color, banned_color=-1;
83
84 /* Don't let foreground be set the same as background and vice-versa */
85 if (c == COLOR_BG)
86 banned_color = *colors[COLOR_FG].setting;
87 else if (c == COLOR_FG)
88 banned_color = *colors[COLOR_BG].setting;
89
83 res = (int)set_color(&screens[SCREEN_MAIN],str(colors[c].lang_id), 90 res = (int)set_color(&screens[SCREEN_MAIN],str(colors[c].lang_id),
84 colors[c].setting,*colors[c].setting); 91 colors[c].setting, banned_color);
85 settings_save(); 92 settings_save();
86 settings_apply(false); 93 settings_apply(false);
87 return res; 94 return res;