Bug#488494: cdebconf: Make the dark theme even more readable
Package: cdebconf
Severity: minor
Tags: patch
Hello,
The current dark theme of newt does not use bright colors, and sometimes
uses background colors for no real use, leading to less readability.
The attached patch makes a few fixes.
The current text frontend does not have a dark theme, this adds one for
the linux and bterm console cases.
Samuel
-- System Information:
Debian Release: lenny/sid
APT prefers testing
APT policy: (990, 'testing'), (500, 'oldstable'), (500, 'unstable'), (500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)
Kernel: Linux 2.6.25
Locale: LANG=fr_FR@euro, LC_CTYPE=fr_FR@euro (charmap=ISO-8859-15)
Shell: /bin/sh linked to /bin/bash
--
Samuel
"And the next time you consider complaining that running Lucid Emacs
19.05 via NFS from a remote Linux machine in Paraguay doesn't seem to
get the background colors right, you'll know who to thank."
(By Matt Welsh)
diff -ur /tmp/cdebconf-0.131/src/modules/frontend/newt/newt.c cdebconf-0.131-mine/src/modules/frontend/newt/newt.c
--- /tmp/cdebconf-0.131/src/modules/frontend/newt/newt.c 2008-05-06 21:32:47.000000000 +0100
+++ cdebconf-0.131-mine/src/modules/frontend/newt/newt.c 2008-06-29 11:43:45.000000000 +0100
@@ -75,24 +75,27 @@
};
struct newtColors newtAltColorPalette = {
- "white", "blue", /* root fg, bg */
+ /*"white", "blue",*/ /* root fg, bg */
+ "white", "black", /* root fg, bg */
/*"black", "lightgray",*/ /* border fg, bg */
"white", "black", /* border fg, bg */
/*"black", "lightgray",*/ /* window fg, bg */
"white", "black", /* window fg, bg */
/*"white", "black",*/ /* shadow fg, bg */
- "white", "blue", /* shadow fg, bg */
+ "white", "black", /* shadow fg, bg */
/*"red", "lightgray",*/ /* title fg, bg */
"yellow", "black", /* title fg, bg */
- "brightred", "gray", /* button fg, bg */
+ /*"brightred", "gray",*/ /* button fg, bg */
+ "black", "lightgray", /* button fg, bg */
"gray", "brightred", /* active button fg, bg */
"white", "gray", /* checkbox fg, bg */
"yellow", "brown", /* active checkbox fg, bg */
- "yellow", "blue", /* entry box fg, bg */
+ /*"yellow", "blue",*/ /* entry box fg, bg */
+ "white", "black", /* entry box fg, bg */
/*"blue", "lightgray",*/ /* label fg, bg */
"brightred", "black", /* label fg, bg */
/*"black", "lightgray",*/ /* listbox fg, bg */
- "lightgray", "black", /* listbox fg, bg */
+ "white", "black", /* listbox fg, bg */
"yellow", "blue", /* active listbox fg, bg */
/*"black", "lightgray",*/ /* textbox fg, bg */
"white", "black", /* textbox fg, bg */
@@ -100,12 +103,14 @@
/*"white", "blue",*/ /* help line */
"white", "black", /* help line */
"yellow", "blue", /* root text */
- "blue", /* scale full */
- "red", /* scale empty */
+ /*"blue",*/ /* scale full */
+ "gray", /* scale full */
+ /*"red",*/ /* scale empty */
+ "lightgray", /* scale empty */
"blue", "lightgray", /* disabled entry fg, bg */
/*"black", "lightgray",*/ /* compact button fg, bg */
- "lightgray", "black", /* compact button fg, bg */
- "yellow", "gray", /* active & sel listbox */
+ "white", "black", /* compact button fg, bg */
+ "black", "lightgray", /* active & sel listbox */
"black", "brown" /* selected listbox */
};
diff -ur /tmp/cdebconf-0.131/src/modules/frontend/text/text.c cdebconf-0.131-mine/src/modules/frontend/text/text.c
--- /tmp/cdebconf-0.131/src/modules/frontend/text/text.c 2008-04-09 17:34:02.000000000 +0100
+++ cdebconf-0.131-mine/src/modules/frontend/text/text.c 2008-06-29 11:34:22.000000000 +0100
@@ -751,10 +751,18 @@
static int text_initialize(struct frontend *obj, struct configuration *conf)
{
struct frontend_data *data = NEW(struct frontend_data);
+ char *term = getenv("TERM");
+ char *palette = getenv("FRONTEND_BACKGROUND");
data->previous_title = NULL;
obj->data = data;
obj->interactive = 1;
signal(SIGINT, SIG_IGN);
+ if (palette && !strcmp(palette, "dark") &&
+ term && (!strcmp(term, "linux") || !strcmp(term, "bterm"))) {
+ /* Hard-code for these cases */
+ printf("\e[37m\e[40m\e[1m\e[H\e[J");
+ fflush(stdout);
+ }
return DC_OK;
}
Reply to: