diff options
author | Zakk Roberts <midk@rockbox.org> | 2006-03-04 10:55:54 +0000 |
---|---|---|
committer | Zakk Roberts <midk@rockbox.org> | 2006-03-04 10:55:54 +0000 |
commit | 87142ab6bbaa3c8129d9ebbce449ebe66ece523a (patch) | |
tree | 7a6f419cf1bdd1ac25be656d3a3cafa717c247d7 | |
parent | 8fc55d55eb2efc8a5875abe42976e256dd8950e5 (diff) | |
download | rockbox-87142ab6bbaa3c8129d9ebbce449ebe66ece523a.tar.gz rockbox-87142ab6bbaa3c8129d9ebbce449ebe66ece523a.zip |
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.c | 9 | ||||
-rw-r--r-- | apps/gui/color_picker.h | 2 | ||||
-rw-r--r-- | apps/lang/english.lang | 6 | ||||
-rw-r--r-- | apps/settings_menu.c | 4 |
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 @@ | |||
27 | #include "settings.h" | 27 | #include "settings.h" |
28 | #include "scrollbar.h" | 28 | #include "scrollbar.h" |
29 | #include "lang.h" | 29 | #include "lang.h" |
30 | #include "splash.h" | ||
30 | 31 | ||
31 | #define TEXT_MARGIN display->char_width+2 | 32 | #define TEXT_MARGIN display->char_width+2 |
32 | #define SLIDER_START 20 | 33 | #define SLIDER_START 20 |
@@ -177,8 +178,9 @@ static void draw_screen(struct screen *display, char *title, | |||
177 | set_color | 178 | set_color |
178 | returns true if USB was inserted, false otherwise | 179 | returns true if USB was inserted, false otherwise |
179 | color is a pointer to the colour (in native format) to modify | 180 | color is a pointer to the colour (in native format) to modify |
181 | set banned_color to -1 to allow all | ||
180 | ***********/ | 182 | ***********/ |
181 | bool set_color(struct screen *display,char *title, int* color) | 183 | bool set_color(struct screen *display,char *title, int* color, int banned_color) |
182 | { | 184 | { |
183 | int exit = 0, button, slider=0; | 185 | int exit = 0, button, slider=0; |
184 | int rgb_val[3]; /* native depth r,g,b*/; | 186 | int rgb_val[3]; /* native depth r,g,b*/; |
@@ -253,6 +255,11 @@ bool set_color(struct screen *display,char *title, int* color) | |||
253 | #ifdef HAVE_LCD_REMOTE | 255 | #ifdef HAVE_LCD_REMOTE |
254 | case SLIDER_RC_OK: | 256 | case SLIDER_RC_OK: |
255 | #endif | 257 | #endif |
258 | if ((banned_color!=-1) && (banned_color == newcolor)) | ||
259 | { | ||
260 | gui_syncsplash(HZ*2,true,str(LANG_COLOR_UNACCEPTABLE)); | ||
261 | break; | ||
262 | } | ||
256 | *color = newcolor; | 263 | *color = newcolor; |
257 | exit = 1; | 264 | exit = 1; |
258 | break; | 265 | 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 @@ | |||
20 | 20 | ||
21 | #ifdef HAVE_LCD_COLOR /* this file is a bit useless on non color lcds.. */ | 21 | #ifdef HAVE_LCD_COLOR /* this file is a bit useless on non color lcds.. */ |
22 | 22 | ||
23 | bool set_color(struct screen *display,char *title, int* color); | 23 | bool set_color(struct screen *display,char *title, int* color, int banned_color); |
24 | 24 | ||
25 | #endif | 25 | #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 | |||
3778 | eng: "Reset Colours" | 3778 | eng: "Reset Colours" |
3779 | voice: | 3779 | voice: |
3780 | new: | 3780 | new: |
3781 | |||
3782 | id: LANG_COLOR_UNACCEPTABLE | ||
3783 | desc: splash number of tracks inserted | ||
3784 | eng: "Invalid color" | ||
3785 | voice: "" | ||
3786 | 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) | |||
329 | bool res; | 329 | bool res; |
330 | 330 | ||
331 | res = set_color(&screens[SCREEN_MAIN],str(LANG_FOREGROUND_COLOR), | 331 | res = set_color(&screens[SCREEN_MAIN],str(LANG_FOREGROUND_COLOR), |
332 | &global_settings.fg_color); | 332 | &global_settings.fg_color,global_settings.bg_color); |
333 | 333 | ||
334 | screens[SCREEN_MAIN].set_foreground(global_settings.fg_color); | 334 | screens[SCREEN_MAIN].set_foreground(global_settings.fg_color); |
335 | 335 | ||
@@ -341,7 +341,7 @@ static bool set_bg_color(void) | |||
341 | bool res; | 341 | bool res; |
342 | 342 | ||
343 | res = set_color(&screens[SCREEN_MAIN],str(LANG_BACKGROUND_COLOR), | 343 | res = set_color(&screens[SCREEN_MAIN],str(LANG_BACKGROUND_COLOR), |
344 | &global_settings.bg_color); | 344 | &global_settings.bg_color,global_settings.fg_color); |
345 | 345 | ||
346 | screens[SCREEN_MAIN].set_background(global_settings.bg_color); | 346 | screens[SCREEN_MAIN].set_background(global_settings.bg_color); |
347 | 347 | ||