aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/kconfig
diff options
context:
space:
mode:
authorSam Ravnborg <sam@mars.ravnborg.org>2006-07-24 16:04:04 -0400
committerSam Ravnborg <sam@neptun.ravnborg.org>2006-09-30 05:19:19 -0400
commit458972132a705c4a869002354f7f10f395d08c18 (patch)
treea96e2804fd4926f0ba8dd8039e5837fb4cc22485 /scripts/kconfig
parent98e5a1579e7d34fe3803240750a1c48efcd9cb15 (diff)
kconfig/lxdialog: add support for color themes and add blackbg theme
The blackbg theme was originally made by: Han Boetes It was copied from a patch by "Randy.Dunlap" <rdunlap@xenotime.net> which was also the inspiration source for the color theme support. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts/kconfig')
-rw-r--r--scripts/kconfig/lxdialog/util.c73
-rw-r--r--scripts/kconfig/mconf.c15
2 files changed, 81 insertions, 7 deletions
diff --git a/scripts/kconfig/lxdialog/util.c b/scripts/kconfig/lxdialog/util.c
index 08f98b1c4bb3..358f9cc19c53 100644
--- a/scripts/kconfig/lxdialog/util.c
+++ b/scripts/kconfig/lxdialog/util.c
@@ -96,6 +96,66 @@ static void set_classic_theme(void)
96 DLG_COLOR(darrow, COLOR_GREEN, COLOR_WHITE, true); 96 DLG_COLOR(darrow, COLOR_GREEN, COLOR_WHITE, true);
97} 97}
98 98
99static void set_blackbg_theme(void)
100{
101 DLG_COLOR(screen, COLOR_RED, COLOR_BLACK, true);
102 DLG_COLOR(shadow, COLOR_BLACK, COLOR_BLACK, false);
103 DLG_COLOR(dialog, COLOR_WHITE, COLOR_BLACK, false);
104 DLG_COLOR(title, COLOR_RED, COLOR_BLACK, false);
105 DLG_COLOR(border, COLOR_BLACK, COLOR_BLACK, true);
106
107 DLG_COLOR(button_active, COLOR_YELLOW, COLOR_RED, false);
108 DLG_COLOR(button_inactive, COLOR_YELLOW, COLOR_BLACK, false);
109 DLG_COLOR(button_key_active, COLOR_YELLOW, COLOR_RED, true);
110 DLG_COLOR(button_key_inactive, COLOR_RED, COLOR_BLACK, false);
111 DLG_COLOR(button_label_active, COLOR_WHITE, COLOR_RED, false);
112 DLG_COLOR(button_label_inactive, COLOR_BLACK, COLOR_BLACK, true);
113
114 DLG_COLOR(inputbox, COLOR_YELLOW, COLOR_BLACK, false);
115 DLG_COLOR(inputbox_border, COLOR_YELLOW, COLOR_BLACK, false);
116
117 DLG_COLOR(searchbox, COLOR_YELLOW, COLOR_BLACK, false);
118 DLG_COLOR(searchbox_title, COLOR_YELLOW, COLOR_BLACK, true);
119 DLG_COLOR(searchbox_border, COLOR_BLACK, COLOR_BLACK, true);
120
121 DLG_COLOR(position_indicator, COLOR_RED, COLOR_BLACK, false);
122
123 DLG_COLOR(menubox, COLOR_YELLOW, COLOR_BLACK, false);
124 DLG_COLOR(menubox_border, COLOR_BLACK, COLOR_BLACK, true);
125
126 DLG_COLOR(item, COLOR_WHITE, COLOR_BLACK, false);
127 DLG_COLOR(item_selected, COLOR_WHITE, COLOR_RED, false);
128
129 DLG_COLOR(tag, COLOR_RED, COLOR_BLACK, false);
130 DLG_COLOR(tag_selected, COLOR_YELLOW, COLOR_RED, true);
131 DLG_COLOR(tag_key, COLOR_RED, COLOR_BLACK, false);
132 DLG_COLOR(tag_key_selected, COLOR_YELLOW, COLOR_RED, true);
133
134 DLG_COLOR(check, COLOR_YELLOW, COLOR_BLACK, false);
135 DLG_COLOR(check_selected, COLOR_YELLOW, COLOR_RED, true);
136
137 DLG_COLOR(uarrow, COLOR_RED, COLOR_BLACK, false);
138 DLG_COLOR(darrow, COLOR_RED, COLOR_BLACK, false);
139}
140
141/*
142 * Select color theme
143 */
144static int set_theme(const char *theme)
145{
146 int use_color = 1;
147 if (!theme)
148 set_classic_theme();
149 else if (strcmp(theme, "classic") == 0)
150 set_classic_theme();
151 else if (strcmp(theme, "blackbg") == 0)
152 set_blackbg_theme();
153 else if (strcmp(theme, "mono") == 0)
154 use_color = 0;
155
156 return use_color;
157}
158
99static void init_one_color(struct dialog_color *color) 159static void init_one_color(struct dialog_color *color)
100{ 160{
101 static int pair = 0; 161 static int pair = 0;
@@ -144,12 +204,13 @@ static void init_dialog_colors(void)
144/* 204/*
145 * Setup for color display 205 * Setup for color display
146 */ 206 */
147static void color_setup(void) 207static void color_setup(const char *theme)
148{ 208{
149 if (has_colors()) { /* Terminal supports color? */ 209 if (set_theme(theme)) {
150 start_color(); 210 if (has_colors()) { /* Terminal supports color? */
151 set_classic_theme(); 211 start_color();
152 init_dialog_colors(); 212 init_dialog_colors();
213 }
153 } 214 }
154 else 215 else
155 { 216 {
@@ -198,7 +259,7 @@ void init_dialog(void)
198 keypad(stdscr, TRUE); 259 keypad(stdscr, TRUE);
199 cbreak(); 260 cbreak();
200 noecho(); 261 noecho();
201 color_setup(); 262 color_setup(getenv("MENUCONFIG_COLOR"));
202 dialog_clear(); 263 dialog_clear();
203} 264}
204 265
diff --git a/scripts/kconfig/mconf.c b/scripts/kconfig/mconf.c
index 7f973195e79a..ed22b13f8460 100644
--- a/scripts/kconfig/mconf.c
+++ b/scripts/kconfig/mconf.c
@@ -159,7 +159,20 @@ static const char mconf_readme[] = N_(
159"\n" 159"\n"
160"Note that this mode can eventually be a little more CPU expensive\n" 160"Note that this mode can eventually be a little more CPU expensive\n"
161"(especially with a larger number of unrolled categories) than the\n" 161"(especially with a larger number of unrolled categories) than the\n"
162"default mode.\n"), 162"default mode.\n"
163"\n"
164"Different color themes available\n"
165"--------------------------------\n"
166"It is possible to select different color themes using the variable\n"
167"MENUCONFIG_COLOR. To select a theme use:\n"
168"\n"
169"make MENUCONFIG_COLOR=<theme> menuconfig\n"
170"\n"
171"Available themes are\n"
172" mono => selects colors suitable for monochrome displays\n"
173" blackbg => selects a color scheme with black background\n"
174" classic => theme with blue background. The classic look. (default)\n"
175"\n"),
163menu_instructions[] = N_( 176menu_instructions[] = N_(
164 "Arrow keys navigate the menu. " 177 "Arrow keys navigate the menu. "
165 "<Enter> selects submenus --->. " 178 "<Enter> selects submenus --->. "