summaryrefslogtreecommitdiff
path: root/apps/gui/color_picker.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/gui/color_picker.c')
-rw-r--r--apps/gui/color_picker.c9
1 files changed, 8 insertions, 1 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 ***********/
181bool set_color(struct screen *display,char *title, int* color) 183bool 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;