diff options
| author | Barry Wardell <rockbox@barrywardell.net> | 2008-05-06 09:35:43 +0000 |
|---|---|---|
| committer | Barry Wardell <rockbox@barrywardell.net> | 2008-05-06 09:35:43 +0000 |
| commit | c95adecb0770a7eebcb1a9f945c7bc2e8ff302ed (patch) | |
| tree | a8fad16d0a80c12c45f4b8e8a7177f5069d06498 | |
| parent | 5b33a417e31ac8af622b92f810b14714efce1874 (diff) | |
| download | rockbox-c95adecb0770a7eebcb1a9f945c7bc2e8ff302ed.zip rockbox-c95adecb0770a7eebcb1a9f945c7bc2e8ff302ed.tar.gz rockbox-c95adecb0770a7eebcb1a9f945c7bc2e8ff302ed.tar.bz2 rockbox-c95adecb0770a7eebcb1a9f945c7bc2e8ff302ed.tar.xz | |
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.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/apps/menus/theme_menu.c b/apps/menus/theme_menu.c index 21f7ba4..0c01b54 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; |