summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZakk Roberts <midk@rockbox.org>2006-03-04 10:55:54 +0000
committerZakk Roberts <midk@rockbox.org>2006-03-04 10:55:54 +0000
commit87142ab6bbaa3c8129d9ebbce449ebe66ece523a (patch)
tree7a6f419cf1bdd1ac25be656d3a3cafa717c247d7
parent8fc55d55eb2efc8a5875abe42976e256dd8950e5 (diff)
Patch 4765 by Jonathan Gordon - don't allow the same colors to be selected for foreground and background.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8900 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/gui/color_picker.c9
-rw-r--r--apps/gui/color_picker.h2
-rw-r--r--apps/lang/english.lang6
-rw-r--r--apps/settings_menu.c4
4 files changed, 17 insertions, 4 deletions
diff --git a/apps/gui/color_picker.c b/apps/gui/color_picker.c
index efdbe1a0e3..f2813c7e16 100644
--- a/apps/gui/color_picker.c
+++ b/apps/gui/color_picker.c
@@ -27,6 +27,7 @@
#include "settings.h"
#include "scrollbar.h"
#include "lang.h"
+#include "splash.h"
#define TEXT_MARGIN display->char_width+2
#define SLIDER_START 20
@@ -177,8 +178,9 @@ static void draw_screen(struct screen *display, char *title,
set_color
returns true if USB was inserted, false otherwise
color is a pointer to the colour (in native format) to modify
+ set banned_color to -1 to allow all
***********/
-bool set_color(struct screen *display,char *title, int* color)
+bool set_color(struct screen *display,char *title, int* color, int banned_color)
{
int exit = 0, button, slider=0;
int rgb_val[3]; /* native depth r,g,b*/;
@@ -253,6 +255,11 @@ bool set_color(struct screen *display,char *title, int* color)
#ifdef HAVE_LCD_REMOTE
case SLIDER_RC_OK:
#endif
+ if ((banned_color!=-1) && (banned_color == newcolor))
+ {
+ gui_syncsplash(HZ*2,true,str(LANG_COLOR_UNACCEPTABLE));
+ break;
+ }
*color = newcolor;
exit = 1;
break;
diff --git a/apps/gui/color_picker.h b/apps/gui/color_picker.h
index 1fa35f0c70..f5200832ad 100644
--- a/apps/gui/color_picker.h
+++ b/apps/gui/color_picker.h
@@ -20,6 +20,6 @@
#ifdef HAVE_LCD_COLOR /* this file is a bit useless on non color lcds.. */
-bool set_color(struct screen *display,char *title, int* color);
+bool set_color(struct screen *display,char *title, int* color, int banned_color);
#endif
diff --git a/apps/lang/english.lang b/apps/lang/english.lang
index bd7973ef73..b13f7375d5 100644
--- a/apps/lang/english.lang
+++ b/apps/lang/english.lang
@@ -3778,3 +3778,9 @@ desc: menu
eng: "Reset Colours"
voice:
new:
+
+id: LANG_COLOR_UNACCEPTABLE
+desc: splash number of tracks inserted
+eng: "Invalid color"
+voice: ""
+new:
diff --git a/apps/settings_menu.c b/apps/settings_menu.c
index d089960e9d..b74b0a7d57 100644
--- a/apps/settings_menu.c
+++ b/apps/settings_menu.c
@@ -329,7 +329,7 @@ static bool set_fg_color(void)
bool res;
res = set_color(&screens[SCREEN_MAIN],str(LANG_FOREGROUND_COLOR),
- &global_settings.fg_color);
+ &global_settings.fg_color,global_settings.bg_color);
screens[SCREEN_MAIN].set_foreground(global_settings.fg_color);
@@ -341,7 +341,7 @@ static bool set_bg_color(void)
bool res;
res = set_color(&screens[SCREEN_MAIN],str(LANG_BACKGROUND_COLOR),
- &global_settings.bg_color);
+ &global_settings.bg_color,global_settings.fg_color);
screens[SCREEN_MAIN].set_background(global_settings.bg_color);