summaryrefslogtreecommitdiffstats
path: root/apps/menus/display_menu.c
diff options
context:
space:
mode:
authorNicolas Pennequin <nicolas.pennequin@free.fr>2007-09-27 15:42:55 +0000
committerNicolas Pennequin <nicolas.pennequin@free.fr>2007-09-27 15:42:55 +0000
commitf3b015f73b29f2d3514c32a9b8b8f0338b52e358 (patch)
tree65e1694745947a9a7d673811d12155f3b2a03019 /apps/menus/display_menu.c
parent5353473b723749a7cd92d72e94423b74058287dc (diff)
downloadrockbox-f3b015f73b29f2d3514c32a9b8b8f0338b52e358.tar.gz
rockbox-f3b015f73b29f2d3514c32a9b8b8f0338b52e358.tar.bz2
rockbox-f3b015f73b29f2d3514c32a9b8b8f0338b52e358.zip
FS#7808 by Tom Ross, Ken Fazzone and me, with help from Antoine Cellerier.
Add two new line selector types: solid colour and gradient. Solid colour only uses the primary colour setting. The secondary colour setting is used for the gradient. Text colour for the selected item is also changeable. These new settings are a bit controversial so they may be removed later. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@14868 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/menus/display_menu.c')
-rw-r--r--apps/menus/display_menu.c55
1 files changed, 53 insertions, 2 deletions
diff --git a/apps/menus/display_menu.c b/apps/menus/display_menu.c
index c1e574a974..11d1f25e7f 100644
--- a/apps/menus/display_menu.c
+++ b/apps/menus/display_menu.c
@@ -115,7 +115,7 @@ MENUITEM_SETTING(invert, &global_settings.invert, NULL);
#ifdef HAVE_LCD_FLIP
MENUITEM_SETTING(flip_display, &global_settings.flip_display, flipdisplay_callback);
#endif
-MENUITEM_SETTING(invert_cursor, &global_settings.invert_cursor, NULL);
+MENUITEM_SETTING(cursor_style, &global_settings.cursor_style, NULL);
#endif /* HAVE_LCD_BITMAP */
#if LCD_DEPTH > 1
/**
@@ -157,13 +157,55 @@ static int set_bg_color(void)
settings_save();
return res;
}
+
+/* Line selector colour */
+static int set_lss_color(void)
+{
+ int res;
+ res = (int)set_color(&screens[SCREEN_MAIN],str(LANG_SELECTOR_START_COLOR),
+ &global_settings.lss_color,-1);
+
+ screens[SCREEN_MAIN].set_selector_start(global_settings.lss_color);
+ settings_save();
+ return res;
+}
+
+static int set_lse_color(void)
+{
+ int res;
+ res = (int)set_color(&screens[SCREEN_MAIN],str(LANG_SELECTOR_END_COLOR),
+ &global_settings.lse_color,-1);
+
+ screens[SCREEN_MAIN].set_selector_end(global_settings.lse_color);
+ settings_save();
+ return res;
+}
+
+/* Line selector text colour */
+static int set_lst_color(void)
+{
+ int res;
+ res = (int)set_color(&screens[SCREEN_MAIN],str(LANG_SELECTOR_TEXT_COLOR),
+ &global_settings.lst_color,global_settings.lss_color);
+
+ screens[SCREEN_MAIN].set_selector_text(global_settings.lst_color);
+ settings_save();
+ return res;
+}
+
static int reset_color(void)
{
global_settings.fg_color = LCD_DEFAULT_FG;
global_settings.bg_color = LCD_DEFAULT_BG;
+ global_settings.lss_color = LCD_DEFAULT_LS;
+ global_settings.lse_color = LCD_DEFAULT_BG;
+ global_settings.lst_color = LCD_DEFAULT_FG;
screens[SCREEN_MAIN].set_foreground(global_settings.fg_color);
screens[SCREEN_MAIN].set_background(global_settings.bg_color);
+ screens[SCREEN_MAIN].set_selector_start(global_settings.lss_color);
+ screens[SCREEN_MAIN].set_selector_end(global_settings.lse_color);
+ screens[SCREEN_MAIN].set_selector_text(global_settings.lst_color);
settings_save();
return 0;
}
@@ -171,6 +213,12 @@ MENUITEM_FUNCTION(set_bg_col, 0, ID2P(LANG_BACKGROUND_COLOR),
set_bg_color, NULL, NULL, Icon_NOICON);
MENUITEM_FUNCTION(set_fg_col, 0, ID2P(LANG_FOREGROUND_COLOR),
set_fg_color, NULL, NULL, Icon_NOICON);
+MENUITEM_FUNCTION(set_lss_col, 0, ID2P(LANG_SELECTOR_START_COLOR),
+ set_lss_color, NULL, NULL, Icon_NOICON);
+MENUITEM_FUNCTION(set_lse_col, 0, ID2P(LANG_SELECTOR_END_COLOR),
+ set_lse_color, NULL, NULL, Icon_NOICON);
+MENUITEM_FUNCTION(set_lst_col, 0, ID2P(LANG_SELECTOR_TEXT_COLOR),
+ set_lst_color, NULL, NULL, Icon_NOICON);
MENUITEM_FUNCTION(reset_colors, 0, ID2P(LANG_RESET_COLORS),
reset_color, NULL, NULL, Icon_NOICON);
#endif
@@ -208,8 +256,11 @@ MAKE_MENU(lcd_settings,ID2P(LANG_LCD_MENU),
# ifdef HAVE_LCD_FLIP
,&flip_display
# endif
- ,&invert_cursor
+ ,&cursor_style
#endif /* HAVE_LCD_BITMAP */
+#ifdef HAVE_LCD_COLOR
+ ,&set_lss_col, &set_lse_col, &set_lst_col
+#endif
#if LCD_DEPTH > 1
,&clear_main_bd,
#endif