diff options
author | Dave Chapman <dave@dchapman.com> | 2006-02-26 02:48:05 +0000 |
---|---|---|
committer | Dave Chapman <dave@dchapman.com> | 2006-02-26 02:48:05 +0000 |
commit | 603f87fe3c0557cb31386fb89c0a49fb72102735 (patch) | |
tree | fa75366ddf1a1dc293e49ec29b9944d448da6c67 /apps/settings_menu.c | |
parent | dd2a5294d67266e5cf7b8739d645a2cf6edd7a28 (diff) |
Foreground/Background colour settings. Based on patch #3050 by Jonathan Gordon, extended my me. The principle of the patch is that the three sliders contain the native ranges (currently 0..31, 0..63, 0..31), and the equivalent RGB888 colour is displayed underneath. The config block (and global_settings struct) contain the native value for the fg/bg colours (either RGB565 or RGB565SWAPPED), but the text .cfg files contain the RGB888 value written as 6 hex digits.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@8840 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/settings_menu.c')
-rw-r--r-- | apps/settings_menu.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/apps/settings_menu.c b/apps/settings_menu.c index 6ac0b6feb2..d089960e9d 100644 --- a/apps/settings_menu.c +++ b/apps/settings_menu.c @@ -54,6 +54,7 @@ #include "splash.h" #include "yesno.h" #include "list.h" +#include "color_picker.h" #ifdef HAVE_LCD_BITMAP #include "peakmeter.h" @@ -319,6 +320,43 @@ static bool clear_main_backdrop(void) lcd_set_backdrop(NULL); return true; } + +/** + * Menu for fore/back colors + */ +static bool set_fg_color(void) +{ + bool res; + + res = set_color(&screens[SCREEN_MAIN],str(LANG_FOREGROUND_COLOR), + &global_settings.fg_color); + + screens[SCREEN_MAIN].set_foreground(global_settings.fg_color); + + return res; +} + +static bool set_bg_color(void) +{ + bool res; + + res = set_color(&screens[SCREEN_MAIN],str(LANG_BACKGROUND_COLOR), + &global_settings.bg_color); + + screens[SCREEN_MAIN].set_background(global_settings.bg_color); + + return res; +} + +static bool reset_color(void) +{ + global_settings.fg_color = LCD_DEFAULT_FG; + global_settings.bg_color = LCD_DEFAULT_BG; + + screens[SCREEN_MAIN].set_foreground(global_settings.fg_color); + screens[SCREEN_MAIN].set_background(global_settings.bg_color); + return false; +} #endif /** @@ -1586,6 +1624,9 @@ static bool lcd_settings_menu(void) #endif #ifdef HAVE_LCD_COLOR { ID2P(LANG_CLEAR_BACKDROP), clear_main_backdrop }, + { ID2P(LANG_BACKGROUND_COLOR), set_bg_color }, + { ID2P(LANG_FOREGROUND_COLOR), set_fg_color }, + { ID2P(LANG_RESET_COLORS), reset_color }, #endif }; |